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 trialAshikur Rahman
Python Web Development Techdegree Student 932 PointsProblem with the loop
Hi! My code not looping second time as like first time. Also the while loop iterating 6 time while my condition is less than or equal to 5.
My code is here. Visit the link
1 Answer
Emmanuel C
10,636 PointsFor the iteration part, you made guesses an array, which in most languages arrays are zero based. So when you have len(guesses) <= 5 it will go from 0 to 5, which is 6 iterations. Simply make it less than instead of less than OR EQUAL to 5.
Ashikur Rahman
Python Web Development Techdegree Student 932 PointsAshikur Rahman
Python Web Development Techdegree Student 932 PointsWhat about loop after ending the game? It's not looping like first time. could you please help me?