Skip to content

Instantly share code, notes, and snippets.

@Deep18-03
Created March 29, 2020 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Deep18-03/fda89d56745a873614f25d34962c609d to your computer and use it in GitHub Desktop.
Save Deep18-03/fda89d56745a873614f25d34962c609d to your computer and use it in GitHub Desktop.
#guess the number program
from random import *
secret_no=randint(1,20)
for guess_taken in range(1,7):
guess_no=int(input("enter the number between 1 to 20 "))
if guess_no < secret_no:
print('your guess is low')
elif guess_no > secret_no:
print('your guess is high')
else:
break
if guess_no==secret_no:
print('your assumption is true'+' secret number is '+str(secret_no))
else:
print('you fail')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment