Skip to content

Commit 2d0daee

Browse files
authored
Update dictionary_return_type_example.py
1 parent 7a602e4 commit 2d0daee

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
game_stock = {"Dragon Quest": 5, "Final Fantasy": 1, "Age of Empires": 5}
22

3+
34
def get_highest_stock_games(game_stock: dict[str, int]) -> dict[str, int]:
45
max_quantity = max(game_stock.values())
5-
return {game: quantity for game, quantity in game_stock.items()
6-
if quantity == max_quantity}
7-
6+
return {
7+
game: quantity
8+
for game, quantity in game_stock.items()
9+
if quantity == max_quantity
10+
}
11+
12+
813
print(f"Games with the highest stock: {get_highest_stock_games(game_stock)}")

0 commit comments

Comments
 (0)