Given this nested dictionary, how could I print all the \"phone\" values using a for loop?
people = {
\'Alice\': {
\'phone\': \'2341\',
\
Loop over the values and then use get() method, if you want to handle the missing keys, or a simple indexing to access the nested values. Also, for the sake of optimization you can do the whole process in a list comprehension :
>>> [val.get('phone') for val in people.values()]
['4563', '9102', '2341']