Posts: 69
Threads: 0
Joined: Dec 2017
Dec-17-2017, 07:33 PM
(This post was last modified: Dec-17-2017, 07:42 PM by Terafy.)
Well this is the code that worked for me... never ran Wavic one. See how very close you were!
def number_of_polluted_days(januar):
k = {}
for day, data in januar.items():
for city, pollution in data.items():
d = ['Texas', 'Moscow', 'Berlin', 'Athens']
if city not in k:
k[city]=0
if pollution >= 50:
k[city] += 1
return k
januar = {
1: {'Texas': 126, 'Moscow': 64, 'Berlin': 57, 'Athens': 35,},
2: {'Texas': 53, 'Moscow': 56, 'Berlin': 58,},
3: {'Texas': 34, 'Moscow': 71, 'Berlin': 48, 'Athens': 55,}
}
print(number_of_polluted_days(januar))
Don't stay silent! If we're out of the loop we can't help you... so voice your trouble :)
When my code doesn't work I don't know why **think** and when my code works I don't know why **think**