PYTHON_SOLVES Telegram 49
## Аргументы по умолчанию

Тема:
Как задавать значения, если их не передали.

def greet(name="гость"):
print("Привет,", name)

greet() # Привет, гость
greet("Андрей") # Привет, Андрей


Полезные советы:

* Аргументы по умолчанию упрощают код, особенно в утилитах и чат-ботах.
* Значения по умолчанию задаются справа налево.

#азы



tgoop.com/python_solves/49
Create:
Last Update:

## Аргументы по умолчанию

Тема:
Как задавать значения, если их не передали.

def greet(name="гость"):
print("Привет,", name)

greet() # Привет, гость
greet("Андрей") # Привет, Андрей


Полезные советы:

* Аргументы по умолчанию упрощают код, особенно в утилитах и чат-ботах.
* Значения по умолчанию задаются справа налево.

#азы

BY Python решает 🐍


Share with your friend now:
tgoop.com/python_solves/49

View MORE
Open in Telegram


Telegram News

Date: |

Telegram has announced a number of measures aiming to tackle the spread of disinformation through its platform in Brazil. These features are part of an agreement between the platform and the country's authorities ahead of the elections in October. ZDNET RECOMMENDS Telegram offers a powerful toolset that allows businesses to create and manage channels, groups, and bots to broadcast messages, engage in conversations, and offer reliable customer support via bots. But a Telegram statement also said: "Any requests related to political censorship or limiting human rights such as the rights to free speech or assembly are not and will not be considered." On June 7, Perekopsky met with Brazilian President Jair Bolsonaro, an avid user of the platform. According to the firm's VP, the main subject of the meeting was "freedom of expression."
from us


Telegram Python решает 🐍
FROM American