Three Basic Methods to remove items in Lists in Python - S1 EP05 P2 - #python
Python Tip #46 (of 365):
Use non-primitive objects as dictionary keys.
The phrase "primitive types" isn't in the Python docs, but folks sometimes borrow that phrase from other language to refer to strings, numbers, & bools.
But those are NOT the only valid dictionary keys!
Any hashable object can be used as a dictionary key, including strings, numbers, and even tuples:
>>> coordinates = {(0, 1): "purple", (5, 4): "green"}
>>> coordinates[(0, 1)]
'purple'
🧵 (1/2)
Как я написал Telegram-бота для SEO-аудита и не дал ему стать инструментом для атак
Рекомендация по КДПВ: Практический гайд по созданию Telegram-бота для автоматизированного анализа сайта: broken links, базовый security-check, отчёты. Минимум теории — максимум рабочего кода.
https://habr.com/ru/articles/996844/
#Telegram_бот #Python #SSRF #rate_limiting #Redis #SEO_аудит #БаденБаден #pyTelegramBotAPI #DNS_rebinding #битые_ссылки
imgui_bundle, a library for writing GUI apps with Python is amazing.
What is less amazing is that they are doing *exactly* what Wayland critics of protocol ext-zones was afraid of, misusing the reposition API to drag windows around. 🤦
In this case though, they are misusing xdg_popup as a kind of 'child window', and using reposition API when dragged. But this should be done with XDG child window without decorations.
Bug could be in #SDL or #Imgui_bundle
#Wayland #Linux #Python #ImGui
Von TIC-80 lernen heißt Pyxel lernen 🤖
Zu der kleinen (Python 3-) Retrogame Engine Pyxel gibt es leider nur sehr wenige Tutorials, weder auf YouTube noch sonst in Textform irgendwo im Web. So mußte ich für meine jüngst aufgekeimte Idee, selber ein paar Tutorials zu Pyxel zu schreiben, nach anderen Quellen für eine Inspiration suchen. https://kantel.github.io/posts/2026021501_tic-80_tutorials/ #TIC80 #Pyxel #Python #Retrogaming #GameDev

Season 1 Lesson 2 Part 6 - Your First Steps - Python Global Keyword - Explained #softwaredeveloper #pythoncode #pythonprogramming #dataanalysis #vibecoding #dataengineer #codingtutorial #python #learncoding #jupyternotebook
Season 1 Lesson 2 Part 5 - Your First Steps - Python - What Are Global Variables #jupyternotebook #vibecoding #dataengineer #codingtutorial #python #learncoding #softwaredeveloper #pythoncode #pythonprogramming #dataanalysis
50 LLM-клеток пытались построить организм. Вот что получилось
Что если заменить мертвые правила «Игры в Жизнь» Конвея на крошечные нейросети? Я провел эксперимент: выдал каждой клетке свой «мозг» — LittleLM весом всего 6 килобайт — и заставил их договариваться друг с другом. Вдохновившись опытами биолога Майкла Левина, я попытался вырастить цифровой организм из 50 автономных агентов. В результате они не только построили структуру без единого центра управления, но и самостоятельно изобрели «рак».
https://habr.com/ru/articles/996836/
#Искусственная_жизнь #LLM #Клеточные_автоматы #Эмерджентность #Python #PyTorch #Майкл_Левин #Эволюционные_алгоритмы #Artificial_Life #Машинное_обучение
Version 0.23.3 of #Lisien, which manages the rules and world state of your #Maxis-style sim game, fixes the Android build.
Get it on itch: https://clayote.itch.io/lisien/devlog/1383122/v0233-fix-android
Or in your Python interpreter: python -m pip install -U lisien elide
#lifeSim #gameDev #python #itch #itchio #aLife #artificialLife #cellularAutomata
Why use OrderedDict if #Python dicts are now ordered?
Because equality checks order too:
d1 = {'a':10, 'b':20}
d2 = {'b':20, 'a':10}
d1 == d2 # True — dicts ignore order
od1 = OrderedDict(a=10, b=20)
od2 = OrderedDict(b=20, a=10)
od1 == od2 # False!

Монотонный стек: описание и примеры применения
Всем привет. В этой статье хотел бы рассказать о структуре данных под названием монотонный стек (monotonic stack) и разобрать несколько примеров задач в решении которых он применим. Статья может быть интересна любителям решать алгоритмические задачи, в особенности тем кто готовится к собеседованию.
https://habr.com/ru/articles/996802/
#python #алгоритмы #leetcode #задачи_для_собеседований #задачи_по_программированию #структуры_данных #занимательные_задачи #теория_сложности
Python Dictionary Merge Trick That Saves Time
Watch this! Python dictionary unpacking merges dicts in one line. See how {**a, **b} works. Game changer for data processing!
#python #pythontricks #codingtips #programmingtutorial #pythondictionaries #dictmerge #dictionaryunpacking #pythonquiz #codingchallenge #pythonshorts #dictoperations #pythondata
https://www.youtube.com/watch?v=X3EWzg2vgMk