-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmelon_info.py
35 lines (21 loc) · 911 Bytes
/
melon_info.py
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
"""Print out all the melons in our inventory."""
from melons import melons
# def print_melon(name, price, seedless):
# """Print each melon with corresponding attribute information."""
# have_or_have_not = 'have'
# if seedless:
# have_or_have_not = 'do not have'
# print(f'{name}s {have_or_have_not} seeds and are ${price}')
# for i in melon_names:
# print_melon(melon_names[i], melon_prices[i], melon_seedlessness[i])
# for i in melons.items():
# # print(melons[i], melons[i][0], melons[i][1])
# print(i)
def print_all_melons(melons):
"""Print each melon with corresponding attribute information."""
for melon_name, attributes in melons.items():
print(melon_name.upper())
for attribute, value in attributes.items():
print(f'{attribute}: {value}')
print('===================================')
print_all_melons(melons)