Как работает функция def в Python?
Ответы

Ilia Kaziamov
05 ноября 2022
def
- это ключевое слово, после которого должно идти определение функции (название новой функции, параметры и двоеточие, после которого описывается тело функции)
Из оф.документации:
The keyword def introduces a function definition. It must be followed by the function name and the parenthesized list of formal parameters. The statements that form the body of the function start at the next line, and must be indented.
Пример:
def say_hello(message):
print(message)
0
0
Добавьте ваш ответ