-3
>>> def f(x):
... return x**2
  File "<stdin>", line 2
    return x**2
    ^
IndentationError: expected an indented block
Sayse
  • 42,633
  • 14
  • 77
  • 146

1 Answers1

0

Here you are:

>>> def f(x):
...     return x**2 
... 
>>> f(2) 
4

Python Indentation

Indentation refers to the spaces at the beginning of a code line.

Where in other programming languages the indentation in code is for readability only, the indentation in Python is very important.

Python uses indentation to indicate a block of code.

For more information regarding indentation please check this tutorial.

funk
  • 2,221
  • 1
  • 24
  • 23