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

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,190 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.