[aphadke@DESKTOP-TP18Q4P cvplay]$ python
Python 3.8.5 (default, Aug 12 2020, 00:00:00)
[GCC 10.2.1 20200723 (Red Hat 10.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> x = 1
>>> def foo():
... x = 2
File "<stdin>", line 2
x = 2
^
IndentationError: expected an indented block
>>> def foo():
... x = 2
... print(x)
... global x
... print(x)
...
File "<stdin>", line 4
SyntaxError: name 'x' is used prior to global declaration