title: How do I add to odd index values in python?
body: <p>I have to process the list to add an amount to every odd position. For example, if I start with </p>
  
  <pre><code>def main():
      L = [1,3,5,7,9,11]
  </code></pre>
  
  <p>and have to add 5 to each odd position, the output should be </p>
  
  <pre><code>    L = [1,8,5,12,9,16]
  </code></pre>
  
  <p>I'm stumped as to where to begin, I am supposed to use indexing and a for loop but everything I try is not working. Here's what I have so far</p>
  
  <pre><code>def main():
      L = [3,12,9,5,7,6,8]
      i=0
      while i &lt; len(L):
        if i%2 == 1:
           print L[i]
           i = i+5
         elif i%2 == 0:
           print L
  </code></pre>