Hi,
I see that this works with single integer values but not when the value is a list. I thought that adding another for loop would allow me to into the lists but it throws an error. What am I missing here?
Thanks!!
**In the below code I’ve edited the first print statement dictionary to include a value with a list “print(add_ten({1:[5, 10], 2:2, 3:3}))”
# Write your add_ten function here:
def add_ten(my_dictionary):
for v in my_dictionary:
my_dictionary[v] += 10
for l in v:
my_dictionary[l] += 10
return my_dictionary
# Uncomment these function calls to test your function:
print(add_ten({1:[5, 10], 2:2, 3:3}))
# should print {1:15, 2:12, 3:13}
print(add_ten({10:1, 100:2, 1000:3}))
# should print {10:11, 100:12, 1000:13}