CBSE Class 11 Informatics Practices Question 78 of 102

Python Programming Fundamentals — Question 39

Back to all questions
39
Question

Question 26(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.