+ 1
My version of Guess number Game , what do you think ??
#Game to guess number with friends from random import randint print("\t\t\tguess game".upper()) print("") number=randint(1,20) chance=3 while chance >0: try: guess=int(input("guess one number between 1 and 20 : ")) except: print("please enter a number") if guess <0 or guess>20 guess =="": raise Exception("enter number between 1 and 20 please") chance-=1 if guess>number: print("It's too high ") print(f"You have {chance} guesses remaining ") elif guess<number: print("It's too low") print(f"You have {chance} guesses remaining") else: print(f"Congralutation , you found it , the number is {number}") break if chance==0: print("You lose, try your chance another time :D ")
6 Answers
+ 4
Advertise your code in feed section or active threads
+ 1
Nicee, but please, prefer create a code then paste the code in instead! You might get high views..
0
Dragon RB
Dragon RB - avatar Thank you for your answer, I have created a code but I don't had any revieuw , also I'm just begining to learn how to use this section of forum and how to share my code with other.
0
Hasnain [ACTIVE CHALLENGER]
Hasnain [ACTIVE CHALLENGER] - avatar
Thank you for your answer,
I don't understand what do you means .
I have created a code in section code bit, but I don't had any review
0
Thank you