Question 11
What is the output of the following snippet?
- two
- one
- (‘one’, ‘two’, ‘three’)
- three
Question 12
What is the expected output of the following code?
- [3, 1, 25, 5, 20, 5, 4]
- [1, 3, 4, 5, 20, 5, 25]
- [3, 5, 20, 5, 25, 1, 3]
- [1, 3, 3, 4, 5, 5, 20, 25]
- [3, 4, 5, 20, 5, 25, 1, 3]
Question 13
Which of the following sentences is true?
- str1 and str2 are different (but equal) strings.
- str1 and str2 are different names of the same strings.
- str1 is longer than str2
- str2 is longer than str1
Question 14
The fact that tuples belong to sequence types means:
- they can be modified using the del instruction
- they can be extended using the .append() method
- they are actually lists
- they can be indexed and sliced like lists
Question 15
What is the output of the following code?
- [1, 1, 1]
- [3, -1, 1]
- [3, 1, 1]