Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics Functions and Looping While Loops

Sean Flanagan
Sean Flanagan
33,231 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,231 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!