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 Python Basics Functions and Looping While Loops

Sean Flanagan
Sean Flanagan
33,235 Points

Incrementation

To increment attempt_count is it possible to use this line:

attempt_count++

Does Python support this?

3 Answers

Haisam Elkewidy
Haisam Elkewidy
26,987 Points

No, Python doesn't support that. Let's say you want to increment by 1. What you can do instead is:

attempt_count += 1

Why there is a = in there ?

Thanks !

Haisam Elkewidy
Haisam Elkewidy
26,987 Points

I 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
Sean Flanagan
33,235 Points

Thanks 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!