Skip to content

Commit eeedda4

Browse files
committed
Create solution for "Making a list of shopping items"
1 parent 3c29524 commit eeedda4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

shopping.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
def main():
2+
item = " "
3+
shopping_list = []
4+
while item != "":
5+
item = input("Next item: ")
6+
if item != "":
7+
shopping_list.append(item)
8+
print("Number of items:", len(shopping_list))
9+
shopping_list.sort()
10+
for shopping_item in shopping_list:
11+
print("-", shopping_item)
12+
13+
14+
if __name__ == "__main__":
15+
main()

0 commit comments

Comments
 (0)