Skip to content

Instantly share code, notes, and snippets.

@albionbrown
Last active June 15, 2022 17:04
Show Gist options
  • Save albionbrown/72559f034f014b6f27740cf585e4f8e4 to your computer and use it in GitHub Desktop.
Save albionbrown/72559f034f014b6f27740cf585e4f8e4 to your computer and use it in GitHub Desktop.
game_store_name = 'Blockbuster'
games = []
def add_game(name, age, category):
game = {
'name': name,
'age': age,
'category': category
}
games.append(game)
# end of add_game()
def remove_game(name):
for id, game in enumerate(games):
if (game['name'] == name):
del games[id]
# end of remove_game()
add_game('Halo', 16, 'FPS')
add_game('Rocket League', 3, 'Esports')
add_game('Sonic', 5, 'Retro')
add_game('Mario', 3, 'Retro')
remove_game('Halo')
print(games)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment