- import os
- print("\nWelcome, enter Your name please")
- name = input("--> ")
- def username(name): #NAME
- while len(name) < 2:
- print("There was an error")
- name = input("\nPlease enter Your name again -->")
- else:
- print("Hello,", name)
- username(name)
- def menu(): #MENU
- print("\nWelcome to the menu")
- print("From here You can chose the game")
- print("For now, we have only 3 game but there will be plenty more!")
- print("Chose game by it's number ")
- print("1 - Coin flip| 2 - Horse racing| 3 - Loto|")
- menu()
- game = int(input("--> "))
- def choice(game): #CHOOSING GAME
- while game > 3 or game < 1:
- print("\nSomething went wrong, enter game you want again (only numbers 1, 2, 3!")
- game = int(input("--> "))
- elif game = '1': #bug here
- print("You chose Coin flip game")
- os.system('python coinflip.py')
- elif game == '2': #and here
- print("You chose Horse racing game")
- os.system('python horseracing.py')
- elif game == '3': #and here
- print("You chose Loto game")
- os.system("python loto.py")
- choice(game)