forked from CodecoolKRK20172/python_game_inventory
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgameInventory.py
More file actions
43 lines (32 loc) · 1.47 KB
/
gameInventory.py
File metadata and controls
43 lines (32 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# This is the file where you must work. Write code in the functions, create new functions,
# so they work according to the specification
# Displays the inventory.
def display_inventory(inventory):
pass
# Adds to the inventory dictionary a list of items from added_items.
def add_to_inventory(inventory, added_items):
pass
# Takes your inventory and displays it in a well-organized table with
# each column right-justified. The input argument is an order parameter (string)
# which works as the following:
# - None (by default) means the table is unordered
# - "count,desc" means the table is ordered by count (of items in the inventory)
# in descending order
# - "count,asc" means the table is ordered by count in ascending order
def print_table(inventory, order=None):
pass
# Imports new inventory items from a file
# The filename comes as an argument, but by default it's
# "import_inventory.csv". The import automatically merges items by name.
# The file format is plain text with comma separated values (CSV).
def import_inventory(inventory, filename="import_inventory.csv"):
pass
# Exports the inventory into a .csv file.
# if the filename argument is None it creates and overwrites a file
# called "export_inventory.csv". The file format is the same plain text
# with comma separated values (CSV).
def export_inventory(inventory, filename="export_inventory.csv"):
pass
# Main function sets initial variables and stores rest of the functions
def main():
pass