def welcome(name):
print ('Hello' ,(name) ,'and welcome to the World of Games (WoG).\nHere you can find many cool games to play.')
def load_game():
print ('1. Memory Game - a sequence of numbers will appear for 1 second and you have to guess it back\n2. Guess Game - guess a number and see if you chose like the computer\n3. Currency Roulette - try and guess the value of a random amount of USD in ILS Gets an input from the user about the game he chose.')
game = int(input('Please choose a game to play: '))
if game > 0 and game < 4:
print ('You have selected ' ,game)
difficulty()
else:
print ('Please enter a number from 1 to 3')
load_game()
def difficulty():
difficulty = int(input('Please choose game difficulty from 1 to 5: '))
if difficulty > 0 and difficulty < 6:
print ('You have selected ' ,difficulty)
else:
print ('Please enter a number from 1 to 5')
difficulty()
welcome("Guy")
(load_game())
אני מקבל את הודעת השגיאה כשזה נכנס לפונקציה def difficulty(): והתשובה חורגת מ5
כמה שאני מנסה אני לא מבין למה
אם מישהו יכול לעזור אני מאוד ישמח