Skip to content

Instantly share code, notes, and snippets.

@Miha-Pleskovic
Created July 20, 2016 15:25
Show Gist options
  • Save Miha-Pleskovic/4d441ff33e97e75e06d509035953c412 to your computer and use it in GitHub Desktop.
Save Miha-Pleskovic/4d441ff33e97e75e06d509035953c412 to your computer and use it in GitHub Desktop.
Guess The Secret Number
# -*- coding: utf-8 -*-
number = "42"
def language():
lang = raw_input("Choose your language (1 - English | 2 - Slovenian): ").lower()
if lang == "1" or lang == "english":
play()
elif lang == "2" or lang == "slovenian":
igra()
else:
print "Command unknown. Please try again."
language()
def play():
guess = raw_input("Guess the secret number: ")
if guess == number:
print "Congratulations! You won!"
else:
print "Sorry, try again."
play()
def igra():
guess = raw_input("Uganite skrito številko: ")
if guess == number:
print "Čestitke! Zmagali ste!"
else:
print "Žal, poskusite znova."
igra()
language()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment