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


telegram Telegram | DID YOU KNOW?

Date: |

What is Telegram Possible Future Strategies?

Cryptoassets enthusiasts use this application for their trade activities, and they may make donations for this cause.If somehow Telegram do run out of money to sustain themselves they will probably introduce some features that will not hinder the rudimentary principle of Telegram but provide users with enhanced and enriched experience. This could be similar to features where characters can be customized in a game which directly do not affect the in-game strategies but add to the experience.

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.

telegram from sg


Telegram PyThrone
FROM USA