KnowledgeBoat Logo

Computer Science

What is the problem with the following code fragment?


a = 3
    print(a)
b = 4
    print(b)
s = a + b
    print(s)

Python Funda

49 Likes

Answer

The problem with the above code is inconsistent indentation. The statements

print(a)
, print(b), print(s) are indented but they are not inside a suite. In Python, we cannot indent a statement unless it is inside a suite and we can indent only as much is required.

Answered By

18 Likes


Related Questions