Menu

7 Output Following Snippet Code Mydict George 4 Jean 2 Paul 10 Andrew 18 Jacob 8 Mydict St Q43879348

7) What is the output of the following snippet of code? • myDict = { George: 4, Jean: 2, Paul: 10, Andrew: 18, Jacob

7) What is the output of the following snippet of code? • myDict = { ‘George’: 4, ‘Jean’: 2, ‘Paul’: 10, ‘Andrew’: 18, ‘Jacob’: 8} myDict[‘Steve’] = 12 toRemove = [‘George’, ‘Paul’, ‘Jacob’] for elt in toRemove: myDict.pop(elt) print(myDict.values()), A) dict values ([2, 10, 18, 8, 12]) B) dict values ([2, 10, 8, 12]). c) dict values (12, 18, 121). D) dict values ([12, 18, 2]) 8) Suppose you need to print e (exponential) constant defined in the math module. Which of the following code can you use? print(math.e) print(e) from math import e print(e) from math import e print(math.e) Show transcribed image text 7) What is the output of the following snippet of code? • myDict = { ‘George’: 4, ‘Jean’: 2, ‘Paul’: 10, ‘Andrew’: 18, ‘Jacob’: 8} myDict[‘Steve’] = 12 toRemove = [‘George’, ‘Paul’, ‘Jacob’] for elt in toRemove: myDict.pop(elt) print(myDict.values()), A) dict values ([2, 10, 18, 8, 12]) B) dict values ([2, 10, 8, 12]). c) dict values (12, 18, 121). D) dict values ([12, 18, 2]) 8) Suppose you need to print e (exponential) constant defined in the math module. Which of the following code can you use? print(math.e) print(e) from math import e print(e) from math import e print(math.e)

Expert Answer


Answer to 7) What is the output of the following snippet of code? • myDict = { ‘George’: 4, ‘Jean’: 2, ‘Paul’: 10, ‘Andrew’: 18,…

OR