🧑💻 Какие методы есть у генератора, но нет у итератора?
1️⃣send(value) Позволяет передать значение внутрь генератора. Это значение становится результатом выражения yield в теле генератора.
2️⃣throw(type, value=None, traceback=None) Используется для выбрасывания исключения внутри генератора в точке последнего yield. Позволяет обрабатывать ошибки.
3️⃣close() Завершает выполнение генератора, вызывая исключение GeneratorExit. Обычно используется для освобождения ресурсов.
🧑💻 Какие методы есть у генератора, но нет у итератора?
1️⃣send(value) Позволяет передать значение внутрь генератора. Это значение становится результатом выражения yield в теле генератора.
2️⃣throw(type, value=None, traceback=None) Используется для выбрасывания исключения внутри генератора в точке последнего yield. Позволяет обрабатывать ошибки.
3️⃣close() Завершает выполнение генератора, вызывая исключение GeneratorExit. Обычно используется для освобождения ресурсов.
#вопросы_с_собеседований
BY Python tests
Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283
n the U.S. people generally use Bitcoin as an alternative investment, helping diversify a portfolio apart from stocks and bonds. You can also use Bitcoin to make purchases, but the number of vendors that accept the cryptocurrency is still limited. Big companies that accept Bitcoin include Overstock, AT&T and Twitch. You may also find that some small local retailers or certain websites take Bitcoin, but you’ll have to do some digging. That said, PayPal has announced that it will enable cryptocurrency as a funding source for purchases this year, financing purchases by automatically converting crypto holdings to fiat currency for users. “They have 346 million users and they’re connected to 26 million merchants,” says Spencer Montgomery, founder of Uinta Crypto Consulting. “It’s huge.”