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
Post a Comment