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 trialSean Flanagan
33,235 PointsIncrementation
To increment attempt_count
is it possible to use this line:
attempt_count++
Does Python support this?
3 Answers
Haisam Elkewidy
26,987 PointsNo, Python doesn't support that. Let's say you want to increment by 1. What you can do instead is:
attempt_count += 1
Haisam Elkewidy
26,987 PointsI started learning Python after having learned Java, and I ran into the same issue too. Python is a bit of a different beast in comparison to other OOP programming languages.
Glad to have been of help.
Sean Flanagan
33,235 PointsThanks for your help. I've coded in other languages and I wondered if you could do this in Python as well. I've upvoted and given you Best Answer.
Cheers!
cesarmatta
11,592 Pointscesarmatta
11,592 PointsWhy there is a = in there ?
Thanks !