Используйте dict.get() вместо dict[]
Есть несколько способов получения значений из словарей, и даже по такой теме разработчики часто спорят.
Многие получают значения по ключам через квадратные скобки, но если такого ключа нет, то будет вызвано исключение.
Поэтому мы считаем, что лучше использовать метод get у словарей. Его основной плюс заключается в том, что он принимает опциональный аргумент, отвечающий за значение по умолчанию.
Таким образом, если значение по ключу не найдено, то вернется дефолтное значение.
В итоге, мы убираем возможные ошибки в случае, если нужных ключей в словаре нет.
#python#dict
#Python
🐍
The Python Mega Course: Build 10 Real World Applications
Become a Python programmer by learning how to build any Python program from scratch, GUIs, web apps, APIs, and more.
🌟 4.6 - 57462 votes
💰 $84.99
🗣️: Ardit Sulce
🔗Link
-----
Main channel:@repo_science
Coupons:@freecoupons_reposcience
-----
#Python
🐍
Intermediate Python: Solidify your Python Understanding And Build Apps
Let us build our understanding even better working with Python hands-on
🔗Link
-----
Canal principal:@repo_science
Cupones:@freecoupons_reposcience
-----
#Python
🐍
Como todos conocen #Python es un lenguaje de alto nivel de programación e interpretado cuya filosofía hace hincapié en la legibilidad de su código y se utiliza para desarrollar aplicaciones de todo tipo.
A sugerencia de ustedes hemos creado un grupo donde recopilaremos todo el material disponible agrupado por temas, al que pueden unirse aquí:
👇
🔗Link
-----
Canal principal: @repo_science
Cupones: @freecoupons_reposcience
-----
goldendict-ng
下一代 GoldenDict。一款功能丰富的开源词典查找程序,支持多种词典格式和在线词典。
https://xiaoyifang.github.io/goldendict-ng/
https://forum.freemdict.com/
https://github.com/lrorpilla/jidoujisho
Japanese-Chinese dictionaries.
https://cloud.freemdict.com/index.php/s/pgKcDcbSDTCzXCs?path=%2FJAPANESE%2FJpn-Chi
recommend using that add-on for anki:
https://ankiweb.net/shared/info/1344485230
the complete guide of how to configure goldendict-ng for Japanese :
https://tatsumoto-ren.github.io/blog/setting-up-goldendict.html
create anki cards from anime
https://github.com/Ajatt-Tools/mpvacious
#dict
📰 JDownloader site hacked to replace installers with Python RAT malware
The website for the popular JDownloader download manager was compromised earlier this week to distribute malicious Windows and Linux installers, with the Windows payload found deploying a Python-based remote access trojan.
🔗 Source: https://www.bleepingcomputer.com/news/security/jdownloader-site-hacked-to-replace-installers-with-python-rat-malware/
#linux#python
📰 PyPI Packages Deliver ZiChatBot Malware via Zulip APIs on Windows and Linux
Cybersecurity researchers have discovered three packages on the Python Package Index (PyPI) repository that are designed to stealthily deliver a previously unknown malware family called ZiChatBot on Windows and Linux systems."While these wheel packages do implement the features described on their PyPI web pages, their true purpose is to covertly deliver malicious files," Kaspersky.
🔗 Source: https://thehackernews.com/2026/05/pypi-packages-deliver-zichatbot-malware.html
#linux#python
📰 LiteLLM loses game of Trivy pursuit, gets compromised
Python interface for LLMs infected with malware via polluted CI/CD pipeline Two versions of LiteLLM, an open source interface for accessing multiple large language models, have been removed from the Python Package Index (PyPI) following a supply chain attack that injected them with malicious credential-stealing code.…
🔗 Source: https://go.theregister.com/feed/www.theregister.com/2026/03/24/trivy_compromise_litellm/
#python#opensource