Question 41
Which one of the lines should you put in the snippet below to match the expected output? Expected output: Code:
- sorted(list)
- sort(list)
- list.sort()
- list.sorted()
Question 42
Which of the following sentences are true about the code? (Choose two.)
- nums and vals are different lists
- vals is longer than nums
- nums and vals are different names of the same list
- nums and vals have the same length
Question 43
The second assignment:
- extends the list
- doesn't change the list's length
- shortens the list
Question 44
What is the expected output of the following code?
- efg
- abc
- def
- The code is erroneous.
- abcde
- None of the above.
Question 45
Which function does in-place reversal of objects in a list?
- list.sort([func])
- list.pop(obj=list[-1])
- list.remove(obj)
- list.reverse()