Question: What does the following code print? names = { ' Janice ' : 5 , 'Emily': 3 , 'John': 7 , 'Eleanor': 2 } list

What does the following code print?
names ={'Janice': 5, 'Emily': 3, 'John': 7, 'Eleanor': 2}
list_o_names =[]
for name in names:
if names[name]>5:
list_o_names.append(name)
print(list_o_names)
Question 5 options:
['Janice', 'John']
['Janice', 'Emily', 'Eleanor']
['John']
['Janice', 'Emily', 'John', 'Eleanor']

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!