CBSE Class 11 Computer Science Question 64 of 98

Python Programming Fundamentals — Question 26

Back to all questions
26
Question

Question 20(b)

Find out the error(s) in the following code fragment:

a = 30
b = a + b
print (a And b)
Answer

There are two errors in this code fragment:

  1. In the statement b = a+b, variable b is undefined.

  2. In the statement print(a And b), And should be written as and.