Nauč se Python > Materiály > Snake Workshop for PyLadies > Introduction to Python > Defining functions

Defining functions – Řešení [1]

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'pozdrav' is not defined

Python complains about NameError - it doesn't recognize anything called pozdrav.

Python reads the program from top to bottom. It "learns" how to greet with the def command. Before it reaches the def command, the function does not exist.


Toto je stránka lekce z kurzu, který probíhá nebo proběhl naživo s instruktorem.