title: Introductory Python task from the edX MIT class
body: <p>I have recently started learning Python in the MIT class on edX.</p>
  
  <p>However, I have been having some trouble with certain exercises. Here is one of them:</p>
  
  <p>"Write a procedure called oddTuples, which takes a tuple as input, and returns a new tuple as output, where every other element of the input tuple is copied, starting with the first one. So if test is the tuple ('I', 'am', 'a', 'test', 'tuple'), then evaluating oddTuples on this input would return the tuple ('I', 'a', 'tuple'). "</p>
  
  <p>The correct code, according to the lecture, is the following:</p>
  
  <pre><code>def oddTuples(aTup):
     '''
     aTup: a tuple
  
     returns: tuple, every other element of aTup.
     '''
      # a placeholder to gather our response
      rTup = ()
      index = 0
  
      # Idea: Iterate over the elements in aTup, counting by 2
      #  (every other element) and adding that element to
      #  the result
      while index &lt; len(aTup):
          rTup += (aTup[index],)
          index += 2
  
      return rTup
  </code></pre>
  
  <p>However, I have tried to solve it myself in a different way with the following code:</p>
  
  <pre><code>def oddTuples(aTup):
      '''
     aTup: a tuple
  
     returns: tuple, every other element of aTup.
     '''
      # Your Code Here
      bTup=()
      i=0
      for i in (0,len(aTup)-1):
          if i%2==0:
              bTup=bTup+(aTup[i],)
              print(bTup)
          print(i)
          i+=1
      return bTup
  </code></pre>
  
  <p>However, my solution does not work and I am unable to understand why (I think it should do essentially the same thing as the code the tutors provide). </p>