Skip to content

Commit 51e7925

Browse files
Add files via upload
1 parent c969817 commit 51e7925

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: python_study_2/page11/script.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Create a dictionary with keys and values, and assign it to the items variable
2+
items = {"apple":2, "banana":4, "orange":6}
3+
# Create a for loop that gets the keys of items
4+
for item_name in items:
5+
# Print '--------------------------------------------------'
6+
print("---------------------------------------------")
7+
# Print 'Each ___ costs ___ dollars'
8+
print("Each " + item_name + " costs " + str(items[item_name]) + " dollars" )

0 commit comments

Comments
 (0)