title: How to delete an item in a tuple of tuples?
body: <p>I understand that tuple is immutable. Therefore, I am trying to convert the tuple to a list first then delete the item.</p>
  
  <p>My original tuple is <code>('monkey', 'camel', ('python', 'elephant', 'penguin'))</code>. It's a tuple including another tuple inside. I want to delete <code>'python'</code>.</p>
  
  <p>Firstly I defined a flatten() function (I found it from the forum):</p>
  
  <pre><code>def flatten(foo):
      for x in foo:
          if hasattr(x,'__iter__') and not isinstance(x,str):
              for y in flatten(x):
                  yield y
          else:
              yield x
  </code></pre>
  
  <p>Then define the delete function:</p>
  
  <pre><code>def tuple_without(original_tuple,item_remove):
      lst=flatten(list(original_tuple))  #  convert the original tuple to list and flatten it
      return list(x for x in lst if x !=item_remove)
  
  print(tuple_without(new_zoo,'python'))
  </code></pre>
  
  <p>It works and the results shows as:</p>
  
  <pre><code>['monkey', 'camel', 'elephant', 'penguin']
  </code></pre>
  
  <p>I would like to know if there is any better and more Pythonic solution here.</p>