CBSE Class 11 Computer Science Question 74 of 98

Python Programming Fundamentals — Question 36

Back to all questions
36
Question

Question 23(c)

Find errors in the following code fragment.

A = 3
S = A + 10
A = "New"
Q = A / 10
Answer

The error in the given code fragment occurs in the Q = A / 10 line, where it attempts to divide the string "New" by the integer 10. This is not a valid operation and will raise a TypeError.