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

I have a question about the loop video.

In the code it reads: attempt_count = 1

Is this a variable that's actually a function that's counting the attempts made by the user?

I am completely lost with this. Does it matter that it says attempt_count = 1

Or can I even say something like oranges = 1

Im just very confused.

2 Answers

It is just variable name (any name should work even if you call it ''hack_yeah"), but you need to make it readable and at the point.

the function of this variable is a counter , counting how many the user enter the wrong password.

Good luck :)

Very good explanation

Thanks :)

Scott Bailey
Scott Bailey
13,178 Points

As jhon white said it's just a variable name nothing special about it.

When naming variables you should always try to make the name clear as to what it's actually doing (for readability). So you could name it cakes = 1, but anyone who reads your code (even yourself if you revisit it) will have a harder time understanding what it's actually doing.