Skip to content

Commit 4cf50fb

Browse files
authored
Create dictionary.py
1 parent 9a33ea8 commit 4cf50fb

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

dictionary.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Starting Out with Python (4th Edition).
2+
# Tony Gaddis.
3+
# Page 507.
4+
# Q. 5 Galilean Moons of Jupiter.
5+
6+
jupiter_moons = {
7+
'Io': [{'Mean Radius = ': '1821.6 Km', 'Surface Gravity = ': '1.796 m/sec. squared.', 'Orbital Period = ': '1.769 days'}],
8+
'Europa': [{'Mean Radius = ': '1560.8 Km', 'Surface Gravity = ': '1.314 m/sec. squared.', 'Orbital Period = ': '3.551 days'}],
9+
'Ganymede': [{'Mean Radius = ': '2634.1 Km', 'Surface Gravity = ': '1.428 m/sec. squared.', 'Orbital Period = ': '7.154 days'}],
10+
'Callisto': [{'Mean Radius = ': '2410.3 Km', 'Surface Gravity = ': '1.235 m/sec. squared.', 'Orbital Period = ': '16.689 days'}]
11+
}
12+
13+
moon_name = str(input("Enter name of Jupiter's Moon: "))
14+
15+
for group in jupiter_moons[moon_name]:
16+
for key, value in group.items():
17+
print(key, value)

0 commit comments

Comments
 (0)