title: SyntaxError: invalid syntax for a beginner
body: <p>Hi I have been programming in java for a couple of months now and I have had some time off so I wanted to try out some python so I decided to try and write my java programs into python but I can't for the life of me figure out where I'm going wrong on this piece of code. I want to use a for loop and a while loop in this program just for practice but I keep getting an error</p>
  
  <p>Here is my code:</p>
  
  <pre><code>breakLine = "\n-------------------------------------------------\n"
  
  print breakLine
  
  startReading = float(raw_input("Please enter the odometer start reading in Miles "))
  endReading = float(raw_input("Now please enter the odometer end reading in Miles "))
  totalMiles = endReading - startReading
  totalGal = 0.0
  
  gals = [];
  days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"];
  
  for i in range (0, 5):
      gals.insert(i, float(raw_input("Enter gals for " + days[i] + " ")))
      totalGal += gals[i]
      i += 1
  
  avgFuel = totalMiles / totalGal
  
  print breakLine
  print "Below is some information about your weeks travel"
  print breakLine
  
  print ("{0:20} \t {1:20}".format("DAY", "GALLONS USED"))
  print breakLine
  
  x = 0
  
  while x &lt; len(days):
      print ("{0:20} \t {1:20}".format(days[x], str(gals[x]))
      x += 1
  
  print breakLine
  print "You used a total of:", totalGal, "gallons this week"
  print "You travelled a total of:", totalMiles, " Miles this week"
  print "Your average fuel consumption for the week is:", avgFuel, "MPG"
  </code></pre>
  
  <p>and here is the error I get</p>
  
  <pre><code>  File "Week1-2.py", line 31
      x += 1
      ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>any help on this would be great</p>