fork download
  1. import random
  2. # Dictionary of consoles one owns, together with games for that console
  3. consoles = {
  4. "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"],
  5. "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"]
  6. }
  7.  
  8. # Function to select a random game from all games available
  9. S_console = random.choice(list(consoles.keys()))
  10. S_game = random.choice(consoles[S_console])
  11. print(f"Console: {S_console}")
  12. print(f"Game: {S_game}")
Success #stdin #stdout 0.03s 11744KB
stdin
Standard input is empty
stdout
Console: SNES
Game: Chrono Trigger