PCEP-30-02 Practice Test practice questions, page 17 of 20, with answer review and explanations.
Question 81
What is the expected output of the following code? menu = {“bunuelo”: 3.21, “torrijas”: 4.99, “churros”: 1.99} for value in menu.values(): print (str(value) [1], end “”)
nru
The code is eeromeous and cannot be run.
3.214.991.99
…
Question 82
What is the expected output of the following code?
The code raises an exception and outputs nothing.
4
5
6
Question 83
Assuming that the following assignment has been successfully executed: the_list = [“1”, 1, 1.] Which of the following expressions evaluate to True? (Choose two.)
1.1 in the_list[1:3]
the_list.index(“1”) in the_list
len(the_list[0:2]) < 3
the_list.index(‘1’) == 0
Question 84
Assuming that the phone_dir dictionary contains name:number pairs, arrange the code boxes to create a valid line of code which retrieves Martin Eden’s phone number, and assigns it to the number variable.
Question 85
What is the expected output of the following code?