CBSE Class 11 Informatics Practices Question 68 of 102

Python Programming Fundamentals — Question 29

Back to all questions
29
Question

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