Telegram Group & Telegram Channel
Что выведет этот код?

Реализация функции
all
эквивалентна этому:

def all(iterable):
for element in iterable:
if not element:
return False
return True

all([])
- True, потому что iterable пустой список и мы не заходим в цикл.

all([[]])
- False, потому что мы заходим в цикл и первый элемент iterable - пустой список, а
bool([]) = False

all([[[]]]) - True
, потому что первый элемент это уже не пустой список, а список в котором пустой список, т.е.
bool([[]]) = True



tg-me.com/pythrone/5
Create:
Last Update:

Что выведет этот код?

Реализация функции

all
эквивалентна этому:

def all(iterable):
for element in iterable:
if not element:
return False
return True

all([])
- True, потому что iterable пустой список и мы не заходим в цикл.

all([[]])
- False, потому что мы заходим в цикл и первый элемент iterable - пустой список, а
bool([]) = False

all([[[]]]) - True
, потому что первый элемент это уже не пустой список, а список в котором пустой список, т.е.
bool([[]]) = True

BY PyThrone




Share with your friend now:
tg-me.com/pythrone/5

View MORE
Open in Telegram


PyThrone Telegram | DID YOU KNOW?

Date: |

What is Telegram?

Telegram’s stand out feature is its encryption scheme that keeps messages and media secure in transit. The scheme is known as MTProto and is based on 256-bit AES encryption, RSA encryption, and Diffie-Hellman key exchange. The result of this complicated and technical-sounding jargon? A messaging service that claims to keep your data safe.Why do we say claims? When dealing with security, you always want to leave room for scrutiny, and a few cryptography experts have criticized the system. Overall, any level of encryption is better than none, but a level of discretion should always be observed with any online connected system, even Telegram.

NEWS: Telegram supports Facetime video calls NOW!

Secure video calling is in high demand. As an alternative to Zoom, many people are using end-to-end encrypted apps such as WhatsApp, FaceTime or Signal to speak to friends and family face-to-face since coronavirus lockdowns started to take place across the world. There’s another option—secure communications app Telegram just added video calling to its feature set, available on both iOS and Android. The new feature is also super secure—like Signal and WhatsApp and unlike Zoom (yet), video calls will be end-to-end encrypted.

PyThrone from sg


Telegram PyThrone
FROM USA