0
Running the python code(with out any syntax,type error) but it always show me a indented block error.tell why and how to avoid
def func(x,y): return x+y x=str(input(":")) y=str(input(":")) print(func(x,y))
2 Answers
+ 1
Ur getting Bcz of wrong indentation. Correct the indentation of all if, and else conditions, u will get proper answer..!!
Python uses indentation (white space at the beginning of a line) to delimit blocks of code. Other languages, such as C, use curly braces to accomplish this, but in Python indentation is mandatory; programs won't work without it.
Ex: Correct the indentation in return statement.
def func(x, y) :
return (x+y) # Give a tab to get proper indentation...
Hope this helps....!!!
0
def func(x,y):
return x+y