Отображение — это тип контейнера, в котором элементы хранятся в виде пар ключ–значение. Такой объект предоставляет доступ к значениям по ключу, а не по индексу, как в списках. В Python отображения реализуют интерфейсы абстрактных базовых классовcollections.abc.Mapping (для неизменяемых) и collections.abc.MutableMapping (для изменяемых).
К основным методам отображения относятся: ✅get() — безопасное получение значения по ключу ✅items(), keys(), values() — для перебора элементов, ключей и значений соответственно ✅update(), pop(), setdefault() и др. — для изменяемых отображений
Примеры отображений в Python: ✅dict — стандартный словарь ✅defaultdict — словарь с значениями по умолчанию ✅OrderedDict — сохраняет порядок добавления элементов (до Python 3.7) ✅Counter — словарь для подсчёта элементов
Отображение — это тип контейнера, в котором элементы хранятся в виде пар ключ–значение. Такой объект предоставляет доступ к значениям по ключу, а не по индексу, как в списках. В Python отображения реализуют интерфейсы абстрактных базовых классовcollections.abc.Mapping (для неизменяемых) и collections.abc.MutableMapping (для изменяемых).
К основным методам отображения относятся: ✅get() — безопасное получение значения по ключу ✅items(), keys(), values() — для перебора элементов, ключей и значений соответственно ✅update(), pop(), setdefault() и др. — для изменяемых отображений
Примеры отображений в Python: ✅dict — стандартный словарь ✅defaultdict — словарь с значениями по умолчанию ✅OrderedDict — сохраняет порядок добавления элементов (до Python 3.7) ✅Counter — словарь для подсчёта элементов
Bitcoin is built on a distributed digital record called a blockchain. As the name implies, blockchain is a linked body of data, made up of units called blocks that contain information about each and every transaction, including date and time, total value, buyer and seller, and a unique identifying code for each exchange. Entries are strung together in chronological order, creating a digital chain of blocks. “Once a block is added to the blockchain, it becomes accessible to anyone who wishes to view it, acting as a public ledger of cryptocurrency transactions,” says Stacey Harris, consultant for Pelicoin, a network of cryptocurrency ATMs. Blockchain is decentralized, which means it’s not controlled by any one organization. “It’s like a Google Doc that anyone can work on,” says Buchi Okoro, CEO and co-founder of African cryptocurrency exchange Quidax. “Nobody owns it, but anyone who has a link can contribute to it. And as different people update it, your copy also gets updated.”
Telegram Auto-Delete Messages in Any Chat
Some messages aren’t supposed to last forever. There are some Telegram groups and conversations where it’s best if messages are automatically deleted in a day or a week. Here’s how to auto-delete messages in any Telegram chat. You can enable the auto-delete feature on a per-chat basis. It works for both one-on-one conversations and group chats. Previously, you needed to use the Secret Chat feature to automatically delete messages after a set time. At the time of writing, you can choose to automatically delete messages after a day or a week. Telegram starts the timer once they are sent, not after they are read. This won’t affect the messages that were sent before enabling the feature.