Question: Question 17 (1 point) What prints when the following code is run? names = {Janice: 5, Emily: 3, 'John: 7, 'Eleanor: 2} list_o_names = []

 Question 17 (1 point) What prints when the following code is
run? 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)
['Janice, 'Emily, 'Eleanor'] ['Janice', 'Emily: 'John', 'Eleanor'] ['John'] ['Janice, 'John'] Question 18

Question 17 (1 point) What prints when the following code is run? 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) ['Janice, 'Emily, 'Eleanor'] ['Janice', 'Emily: 'John', 'Eleanor'] ['John'] ['Janice, 'John'] Question 18 (1 point) What does the following code print now that it has been updated? names = {"Janice': 5, "Emily": 3, "John": 7, "Eleanor': 2) list_o_names = 0 names['Emily'] += 10 names [ 'Erik'] = 22 for name in names: if names [name] > 5! list_o_names.append(name) print(list_o_names) ['Janice', 'John' , 'Erik'] O ['Emily. John', 'Erik'] ['Janice' , 'Emily: 'John'] ['Janice', 'Emily: 'Eleanor '] Question 19 (1 point) What is the value of counter after the code is run to completion? phrase = "Cheese in Philadelphia is extraordinary according to Erik" counter letters for word in phrase.split(): for letter in word: letter = letter.lower) if letter not in letters.keys(): letters[letter] = @ letters[letter] += 1 for key in letters.keys(): if letters [key] > 2: counter +- 1 11 O 9 5 10 Question 20 (1 point) What value is printed once the code is run? word = 'brontosaurus' diction = 0 for letter in word: if letter not in diction.keys(): diction[letter] = 0 diction[letter] += 1 print(diction.get('o') + 4) 02 2 04 4 O 10

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 Databases Questions!