PYTHON_TG Telegram 2542
Вопрос с собеседования

Можно ли поменять местами две переменные без временной переменной?

Ответ: Да, в Python это можно сделать через распаковку кортежа: a, b = b, a. Это работает, потому что Python сначала создает временный кортеж (b, a), а затем распаковывает его обратно в переменные.

tags: #собеседование

Python Developer | Чат
Please open Telegram to view this post
VIEW IN TELEGRAM



tgoop.com/python_tg/2542
Create:
Last Update:

Вопрос с собеседования

Можно ли поменять местами две переменные без временной переменной?

Ответ: Да, в Python это можно сделать через распаковку кортежа: a, b = b, a. Это работает, потому что Python сначала создает временный кортеж (b, a), а затем распаковывает его обратно в переменные.

tags: #собеседование

Python Developer | Чат

BY Python Developer


Share with your friend now:
tgoop.com/python_tg/2542

View MORE
Open in Telegram


Telegram News

Date: |

End-to-end encryption is an important feature in messaging, as it's the first step in protecting users from surveillance. “[The defendant] could not shift his criminal liability,” Hui said. Clear A Telegram channel is used for various purposes, from sharing helpful content to implementing a business strategy. In addition, you can use your channel to build and improve your company image, boost your sales, make profits, enhance customer loyalty, and more. The court said the defendant had also incited people to commit public nuisance, with messages calling on them to take part in rallies and demonstrations including at Hong Kong International Airport, to block roads and to paralyse the public transportation system. Various forms of protest promoted on the messaging platform included general strikes, lunchtime protests and silent sit-ins.
from us


Telegram Python Developer
FROM American