fork download
  1. import random
  2.  
  3. # List of Console one owns
  4. console = [ "NES" , "SNES" ]
  5. # A list of each game one would want to play for each console
  6. NES = [ "Contra" , "Metroid" , "Mega Man" , "Mega Man 2" , "Mega Man 3" , "Mega Man 4" , "Mega Man 5" , "Mega Man 6" , "Ninja Gaiden", "Ninja Gaiden 2" , "Strider" ]
  7. SNES = [ "Act Raiser" , "Chrono Trigger ", "F-Zero" , "Final Fantasy 2|4" , " Final Fantasy 3|6" , "The legend of Zelda: A Link to the Past" , "Super Mario RPG" , "Super Metroid"]
  8.  
  9. # To be added in later
  10. # List of Genre one might wan to play
  11. genre = ["Action" , "Action-Adventure" , "RPG" , "Sports"]
  12.  
  13. #Function to select a random game from all games available
  14. S_console = random.choice(console)
  15. print(f"Console: {S_console}")
  16.  
  17. S_game = ""
  18. if S_console == "NES":
  19. S_game = random.choice(NES)
  20. elif S_console == "SNES":
  21. S_game = random.choice(SNES)
  22. print(f"Game: {S_game}")
Success #stdin #stdout 0.03s 11636KB
stdin
Standard input is empty
stdout
Console: NES
Game: Strider