Skip to content

Instantly share code, notes, and snippets.

@Manuela82
Created November 20, 2017 21:46
Show Gist options
  • Save Manuela82/57f90c7a0967134095a12ebbf662dfd2 to your computer and use it in GitHub Desktop.
Save Manuela82/57f90c7a0967134095a12ebbf662dfd2 to your computer and use it in GitHub Desktop.
guess_the_secret_number_main_and_random
import random
secret = 28
print "Welcome to 'Guess the secret number'"
def main():
while True:
random_num = random.randint(0, 29)
print "You don't know which number you want to choose? You can take our randomly created number:" " " \
+ str(random_num)
guess = int(raw_input("Guess the secret number (between: 1 and 30): "))
if guess == secret:
print "You guessed it - congratulations! It's number 22:)"
break
else:
print "Sorry, your guess is not correct... Secret number is not " + str(guess)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment