PYTHON_JOB_INTERVIEW Telegram 1174
This media is not supported in your browser
VIEW IN TELEGRAM
🐍 Печатай переменные с их именами без повторов — с помощью f‑строк и := (walrus operator)

Вместо этого:

print(f"x = {x}, y = {y}, z = {z}")


Пиши так:

print(f"{x=}, {y=}, {z=}")

x=42, y='hello', z=[1, 2, 3]


🔥 А ещё лучше — используем := (оператор моржа) для печати и присваивания одновременно:

print(f"{(n := len(mylist))=}")


Это одновременно сохранит len(mylist) в n и выведет его:


n=5
👍144🔥2



tgoop.com/python_job_interview/1174
Create:
Last Update:

🐍 Печатай переменные с их именами без повторов — с помощью f‑строк и := (walrus operator)

Вместо этого:


print(f"x = {x}, y = {y}, z = {z}")


Пиши так:

print(f"{x=}, {y=}, {z=}")

x=42, y='hello', z=[1, 2, 3]


🔥 А ещё лучше — используем := (оператор моржа) для печати и присваивания одновременно:

print(f"{(n := len(mylist))=}")


Это одновременно сохранит len(mylist) в n и выведет его:


n=5

BY Python вопросы с собеседований


Share with your friend now:
tgoop.com/python_job_interview/1174

View MORE
Open in Telegram


Telegram News

Date: |

A vandalised bank during the 2019 protest. File photo: May James/HKFP. Write your hashtags in the language of your target audience. Today, we will address Telegram channels and how to use them for maximum benefit. Although some crypto traders have moved toward screaming as a coping mechanism, several mental health experts call this therapy a pseudoscience. The crypto community finds its way to engage in one or the other way and share its feelings with other fellow members. The visual aspect of channels is very critical. In fact, design is the first thing that a potential subscriber pays attention to, even though unconsciously.
from us


Telegram Python вопросы с собеседований
FROM American