Created
July 20, 2016 15:25
-
-
Save Miha-Pleskovic/4d441ff33e97e75e06d509035953c412 to your computer and use it in GitHub Desktop.
Guess The Secret Number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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