Skip to content

Instantly share code, notes, and snippets.

@amigojapan
Created July 19, 2018 07:22
Show Gist options
  • Save amigojapan/73036e63cf622149938cd58329ed5d59 to your computer and use it in GitHub Desktop.
Save amigojapan/73036e63cf622149938cd58329ed5d59 to your computer and use it in GitHub Desktop.
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")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment