Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Invalid Syntax

Hi all,

I'm not sure why I am getting an invalid syntax error on line 11. It appears to me that I have the same exact code as the teacher does. See below:

travel_expenses = [ [5.00, 2.75, 22.00, 0.00, 0.00], [24.75, 5.50, 15.00, 22.00, 8.00], [2.75, 5.50, 0.00, 29.00, 5.00], ]

print("Travel Expenses:") week_number = 1 for week in travel_expenses: print("* Week *{}: ${}".format(week_number, sum(week)) week_number += 1

treehouse:~/workspace$ python -i expenses.py
File "expenses.py", line 11
week_number += 1
^
SyntaxError: invalid syntax

2 Answers

Hello Michael, it seems you may be missing a parenthesis in your print statement just before you add to the week number.

Thank You!