Hello everyone, This is my first time writing in this Forum. Would really Appreciate if anyone could help me with this code.What this code was supposed to do that the user has to guess a random no. between 1 to 10 and with the no of attempts the user did it would assign the user a phrase.Currently when i’m using it, it is not working as its suppose to.
numbers = random.randint(1,10)
attempts = 0
while True:
try:
guess = int(input("Enter your Guess: "))
if numbers == guess:
attempts = attempts + 1
print("Guess in" + attempts + " attempts. ")
break
elif numbers > guess:
print("Enter a Higher Number")
attempts = attempts + 1
else:
print("Enter a Lower Number")
attempts = attempts + 1
if attempts == 1:
print("Intelligent Guess")
break
elif attempts <= 3:
print("Not Bad")
else:
print("Bit More Luck Required")
except:
print("Choose No. between 1 to 100 ")