Solved

Which of the Following Statements Is False

Question 20

Multiple Choice

Which of the following statements is false?


A) The function modify_elements multiplies each element of its list argument by 2: def modify_elements(items) :
""""Multiplies all element values in items by 2."""
For i in range(len(items) ) :
Items[i] *= 2
B) Part (a) 's function modify_elements' items parameter receives a reference to the original list, so the statement in the loop's suite modifies each element in the original list object.
C) When you pass a tuple to a function, attempting to modify the tuple's immutable elements results in a TypeError.
D) Tuples may contain mutable objects, such as lists, but those objects cannot be modified when a tuple is passed to a function.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions