Hello I cannot seem to get my code to return any value.
My original code was:
room_numbers = {
['Freddie', 'Jen']: 403,
['Ned', 'Keith']: 391,
['Kristin', 'Jazzmyne']: 411,
['Eugene', 'Zach']: 395
}
My new code is listed below
room_numbers = {
tuple (['Freddie', 'Jen']): (403),
tuple (['Ned', 'Keith']): 391,
tuple (['Kristin', 'Jazzmyne']): 411,
tuple (['Eugene', 'Zach']): 395
}
I changed it so I can use the correct data type. I understood that you can not use mutable data types for dictionaries and Python requires us to use immutable datatypes for the keys in a dictionary. However, I cannot figure out how to call upon the dictionary. However, how when I try to call upon the different data type I can not print out any results.
Can you please answer if my change in the code above is correct and how come I can not do the following:
print (room_numbers['Freddie']) #why does this not return 403?
I want to call upon the unique keys to return the unique values assigned to them. What is the process python code for this?