-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path41_dictionariesLoops.py
39 lines (27 loc) · 1.08 KB
/
41_dictionariesLoops.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
36
37
38
39
# Day 41 on Replit: "Dictionaries With Loops"
# Fix my code section
# myDictionary = {"name" : "David the Mildy Terrifying", "health": 186, "strength": 4, "equipped":"l33t haxx0r p0werz"}
# for name in myDictionary.items():
# print(f"{name}:{value}")
# if (name == "strength"):
# if value > 100:
# print("Whoa, SO STRONG")
# else:
# print("Looks like you skipped leg day, arm day, chest day and, well, gym day entirely bro!")
myDictionary = {"name" : "David the Mildy Terrifying", "health": 186, "strength": 4, "equipped":"l33t haxx0r p0werz"}
for name, value in myDictionary.items():
print(f"{name}:{value}")
if (name == "strength"):
if value > 100:
print("Whoa, SO STRONG")
else:
print("Looks like you skipped leg day, arm day, chest day and, well, gym day entirely bro!")
# Challenge section
myDictionary = {"Name" : None, "URL": None, "Description" : None, "Rating": None}
for key in myDictionary:
myDictionary[key] = input(f"{key}: ")
print()
print("-------------------")
print()
for key, value in myDictionary.items():
print(f"{key}: {value}")