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 trialhenry duquesnay
6,976 PointsWhy does this not work!?!!?!
def first_4(1234567) return 1234567[0:4]
shouldn't this work? Why not? i've tried a million combinations and the only thing that works is when i write the word "iterable" in place of the number values
def first_4(1234567)
return 1234567[0:4]
1 Answer
Steven Parker
231,236 PointsTom's right about needing a colon, but another important syntax rule is that parameter names cannot be entirely digits. It doesn't have to be "iterable", almost any name will do; but it cannot start with a digit.
Tom Finch
1,248 PointsTom Finch
1,248 PointsYou will need a colon at the end of your first line.