-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdictionary_peak_starter.py
40 lines (24 loc) · 1.16 KB
/
dictionary_peak_starter.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
# The exercise uses the following "peak" dictionary:
peak = {
"name": "Castle Peak",
"height": 14264,
"summit_log": [],
"cell_reception": {
"AT&T": "no reception",
"T-Mobile": "poor"
}
}
# Without touching the original variable declaration (above)...
# Add a "range" key to peak and set it equal to "Elk Mountains"
# Add a "first_climbed" key to peak and set it equal to 1873
# Whoops, there's a mistake with the peak "height". Update it to 14265
# Add a "Verizon" to the "cell_reception" dict and set it equal to "good"
# You just summited the peak! Add your name to the "summit_log" list
# Let's rename "height" to "elevation":
# Remove "height" from the dict and store the result in a variable.
# Use the value for "height" and store it in the dict under they key "elevation"
# Loop over the values in the dictionary and print them all out. Don't ask why, just do it :)
# Loop over the keys AND values in the dictionary and print them all out in the following format:
# key -> value
# (print an arrow between each pair)
# A huge earthquake/meteor/forestfire/tsunami has destroyed the peak. Please empty out the entire dictionary.