PCEP-30-02: Certified Entry-Level Python Programmer
PCEP-30-02: Certified Entry-Level Python Programmer practice questions, page 6 of 20, with answer review and explanations.
Question 26
Which one of the lines should you put in the snippet below to match the expected output? Expected output: Code:
- reverse(list)
- list.reversed()
- list.reverse()
- reversed(list)
Question 27
What is the expected output of the following code?
- ['1', '2', '3', '4']
- (1, 2, 3, 4)
- ('1', '2', '3', '4')
- The code is erroneous.
Question 28
What is the expected output of the following code?
- (2)
- (2,)
- 2
- The code is erroneous.
Question 29
What is the output of the following snippet?
- -2
- 3
- -1
- 1
Question 30
An alternative name for a data structure called a stack is:
- LIFO
- FIFO
- FOLO