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 trialDavid Lai
1,770 Pointsadd_list question in python
def add_list(numList)
totalSum = 0
for num in some_list
totalSum = totalSum + num
return totalSum
^ here is my code for the function, but it says I have a syntax error at "def add_list(numList)" ... anyone understand why this might be the case?
1 Answer
Kenneth Love
Treehouse Guest TeacherFunction definitions are always followed by a colon (:
). Yours isn't :)
Same for your for
loop.
David Lai
1,770 PointsDavid Lai
1,770 PointsI forgot the colon I think! I could've sworn there was no colon in the video example they showed us.....