+ 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 ")

11th Jun 2023, 10:06 PM
Toufik Hammad
Toufik Hammad - avatar
6 Answers
+ 4
Advertise your code in feed section or active threads
12th Jun 2023, 9:35 AM
Hasnain [ACTIVE CHALLENGER]
Hasnain [ACTIVE CHALLENGER] - avatar
+ 1
Nicee, but please, prefer create a code then paste the code in instead! You might get high views..
12th Jun 2023, 2:50 AM
Dragon RB
Dragon RB - avatar
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.
12th Jun 2023, 6:38 PM
Toufik Hammad
Toufik Hammad - avatar
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
12th Jun 2023, 6:42 PM
Toufik Hammad
Toufik Hammad - avatar
0
Thank you
13th Jun 2023, 7:38 AM
Toufik Hammad
Toufik Hammad - avatar