PCEP-30-02 Practice Test practice questions, page 16 of 20, with answer review and explanations.
Question 76
What is the expected output of the following code?
{(2, 3): 2}
{(1, 2): 1}
The code is erroneous.
1
Question 77
Take a look at the snippet and choose the true statement:
vals is longer than nums
nums is longer than vals
nums and vals have the same length
The snippet will cause a runtime error.
Question 78
What is the expected output of the following code?
3
The code is erroneous.
6
7
Question 79
What is true about tuples? (Choose two.)
The len() function cannot be applied to tuples.
Tuples are immutable, which means that their contents cannot be changed during their lifetime.
An empty tuple is written as ().
Tuples can be indexed and sliced like lists.
Question 80
Assuming that the following assignment has been successfully executed: my_list = [5, 4, 3, 2] Select the expressions which will not raise any exception. (Choose two.)