Telegram Group & Telegram Channel
Находим наименьшие и наибольшие

В стандартной библиотеке есть модуль heapq, который, как можно понять по названию, реализует структуру данных куча.

Особенности и пользу этой структуры данных пока что разбирать не будем, но посмотрим на два интересных метода в этом модуле.

С помощью методов nsmallest и nlargest можно получить наименьшие и наибольшие элементы в списке.

Первым аргументов передается, сколько элементов нужно взять, вторым — список.

#heap



tg-me.com/python_academy/955
Create:
Last Update:

Находим наименьшие и наибольшие

В стандартной библиотеке есть модуль heapq, который, как можно понять по названию, реализует структуру данных куча.

Особенности и пользу этой структуры данных пока что разбирать не будем, но посмотрим на два интересных метода в этом модуле.

С помощью методов nsmallest и nlargest можно получить наименьшие и наибольшие элементы в списке.

Первым аргументов передается, сколько элементов нужно взять, вторым — список.

#heap

BY Python Academy




Share with your friend now:
tg-me.com/python_academy/955

View MORE
Open in Telegram


Python Academy Telegram | DID YOU KNOW?

Date: |

Telegram has exploded as a hub for cybercriminals looking to buy, sell and share stolen data and hacking tools, new research shows, as the messaging app emerges as an alternative to the dark web.An investigation by cyber intelligence group Cyberint, together with the Financial Times, found a ballooning network of hackers sharing data leaks on the popular messaging platform, sometimes in channels with tens of thousands of subscribers, lured by its ease of use and light-touch moderation.

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.

Python Academy from us


Telegram Python Academy
FROM USA