Which of the following Python statements will not result in error? VALS = [1,…
2026
Which of the following Python statements will not result in error?
VALS = [1, "A", 2, "B", 3, "C"]
- A.
print(len(VALS))
- B.
print(max(VALS))
- C.
print(sum(VALS))
- D.
print(VALS.sort())
Attempted by 117 students.
Show answer & explanation
Correct answer: A
The list VALS contains mixed data types (integers and strings). Arithmetic operations like sum() will raise a TypeError because Python cannot add numbers to text. However, the len() function counts items regardless of type and executes successfully.