Q. Why is following code giving errors?


name = "Path Walla"
print("Greetings !!!")
    print("Hello", name)
    print ("How do you do?")


Answer :-

The problem with above code is inconsistent indentation. In Python, we cannot indent a statement unless it is inside a suite and we can indent only as much as required.

Thus, corrected code will be:


name = "Path Walla"
print("Greetings !!!")
print("Hello", name)
print ("How do you do?")

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post