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 trialBrien Brzeski
278 PointsI 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
jhon white
20,006 PointsIt 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 :)
Scott Bailey
13,190 PointsAs 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.
Nick Evershed
6,429 PointsNick Evershed
6,429 PointsVery good explanation
jhon white
20,006 Pointsjhon white
20,006 PointsThanks :)