Oct-25-2022, 05:05 PM
okay, you're right, i did the following and it worked:
import random RNumber = random.randint(1,10) user_input = int(input("please guess a number between 0 and 10: \n")) while user_input != RNumber: if user_input > RNumber: user_input = int(input("choose a lower number: \n")) elif user_input < RNumber: user_input = int(input("choose a higher number: \n")) print("the number you chose is correct (", RNumber, ")")is this correct to do ? (i know it gets the job done, but is it correct to implement it like this ?)