1. import os
  2. print("\nWelcome, enter Your name please")
  3. name = input("--> ")
  4. def username(name): #NAME
  5. while len(name) < 2:
  6. print("There was an error")
  7. name = input("\nPlease enter Your name again -->")
  8. else:
  9. print("Hello,", name)
  10. username(name)
  11. def menu(): #MENU
  12. print("\nWelcome to the menu")
  13. print("From here You can chose the game")
  14. print("For now, we have only 3 game but there will be plenty more!")
  15. print("Chose game by it's number ")
  16. print("1 - Coin flip| 2 - Horse racing| 3 - Loto|")
  17. menu()
  18. game = int(input("--> "))
  19. def choice(game): #CHOOSING GAME
  20. while game > 3 or game < 1:
  21. print("\nSomething went wrong, enter game you want again (only numbers 1, 2, 3!")
  22. game = int(input("--> "))
  23. elif game = '1': #bug here
  24. print("You chose Coin flip game")
  25. os.system('python coinflip.py')
  26. elif game == '2': #and here
  27. print("You chose Horse racing game")
  28. os.system('python horseracing.py')
  29. elif game == '3': #and here
  30. print("You chose Loto game")
  31. os.system("python loto.py")
  32. choice(game)
Comments powered by Disqus