Python Python Basics (2015) Number Game App Number Game Refinement

Ashikur Rahman
Ashikur Rahman
Python Web Development Techdegree Student 932 Points

Problem 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

https://repl.it/JURB/0

1 Answer

Emmanuel C
Emmanuel C
7,633 Points

For 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
Ashikur Rahman
Python Web Development Techdegree Student 932 Points

What about loop after ending the game? It's not looping like first time. could you please help me?