+ 2
Expected an indented block means?? Who to solve
def multiply(x, y): return x * y a = 4 b = 7 operation = multiply print(operation(a, b)) IndentationError:expected an indented block
3 ответов
+ 6
We can help you better if you save your code in the playground and then post a link here.
I copied and pasted your code and it worked fine!
https://code.sololearn.com/c12UZLYfBGY4/?ref=app
+ 2
Moghan kumar
You see, unlike other free-form languages such as JS, C++,C# etc.
Python is not free-form
In python, you don't use Curly braces to denote body of functions, rather you use indentations, meaning spaces at the start of a new line.
Eg Check out these::
Indented.
Indented.
You see the difference right.
So when defining functions, always be sure to indent function bodies.
Eg
def printName():
print("D'lite") ..... Good
def printName():
print ("D'lite") ..... Bad
If you don't indent them, you'll get those IndentationsExpected errors
+ 1
Use Tabs instead of Space...