Oct-25-2022, 04:25 PM
(This post was last modified: Oct-25-2022, 04:26 PM by astral_travel.)
okay, i did the following:
what is the cause ?
import random RNumber = random.randint(0,10) user_input = int(input("please guess a number between 0 and 10: \n")) while user_input != RNumber: user_input = int(input("please guess a number between 0 and 10: \n")) if user_input > RNumber: print("the number you chose is greater than the random number, pleasr try again\n") elif user_input < RNumber: print("the number you chose is smaller than the random number, pleasr try again\n") elif user_input == RNumber: print("the number you chose is correct (", RNumber, ")")which works in one sense, but it does not give the feedback of printing the greater than or smaller than part of the if and elif,
what is the cause ?