Infinite loop in Python cannot stop -


i tried loop keeps giving me infinite loop can me ?

difficulty = int (input ( '"1" easy \n"2" medium \n"3" hard\n'))  while difficulty <= 0 or difficulty >= 4 :   print ('invalid choice. try again!') 

you printing while difficulty within range. problem difficulty variable set once, before loop. try moving inside loop.


Comments

Popular posts from this blog

javascript - How to process users in one specific order using map o each function? -

java - Two interface have same method name with different return type -

javascript - Linking from page A to a specific iframe on page B -