The fact that tuples belong to sequence types means:
A. they can be modi ed using the del instruction
B. they can be extended using the .append() method
C. they are actually lists
D. they can be indexed and sliced like lists
Which function does in-place reversal of objects in a list?
A. list.sort([func])
B. list.pop(obj=list[-1])
C. list.remove(obj)
D. list.reverse()
What is the expected output of the following code?
A. [2]
B. [3, 4, 5]
C. The program will cause an error.
D. [2, 3, 4, 5]
What is the expected output of the following code?
A. 1 1 2 3 4 5
B. 2 3 4 5 6 1
C. 2 3 4 5 6 6
D. 1 2 3 4 5 6
What are the four fundamental elements that make a language?
A. An alphabet, a lexis, a syntax, and semantics
B. An alphabet, morphology, phonetics, and semantics
C. An alphabet, a lexis, phonetics, and semantics
D. An alphabet, phonetics, phonology, and semantics
What is the expected output of the following code?
A. 1
B. Peter
C. None
D. value
E. The code is erroneous.
Which of the following statements can be used to return the length of the given string str?
A. str.size()
B. str._len_()
C. size(str)
D. len(str)
What is the expected output of the following code?
A. 3
B. 13
C. The code is erroneous.
D. 42
Which of the following sentences correctly describes the output of the below Python code?
A. None of the above.
B. res is the sum of all the number in the list.
C. res is the smallest number in the list.
D. res is the largest number in the list.
E. res is the average of all the number in the list.
Consider the following code.
You want to print the numbers 1 to 7 to the monitor. But the code does not work. What do you have to change? (Choose two.)
A. x = x + 1 # Line 8
B. while (x < 10): # Line 3
C. print(nums[x]) # Line 4
D. if nums[x] == 7: # Line 5