Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- num=random.randint(1,100)
- print("I have chosen a number form 1 to 100, try to guess the number...")
- while(True):
- user_num=int(input("enter a number:"))
- if(user_num==num):
- print("you win")
- quit()
- if(abs(user_num-num)<=5):
- print("hot")
- elif(abs(user_num-num)<=15):
- print("warm")
- else:
- print("cold")
Add Comment
Please, Sign In to add comment