🕵️ SicherheitslückenCVE-2026-58728 | Google Android ARM64 MMU mmu.h ARM64_TLBI race condition(15.09.2026 um 21:40 Uhr)
🔧 ProgrammierungEnforce GitHub Advanced Security configurations(15.09.2026 um 21:31 Uhr)
🔧 ProgrammierungHow i give my coding agent a map of the repo with Empryo(15.09.2026 um 21:54 Uhr)
🔧 ProgrammierungReef Connects Agent Feedback, Learning and Versioned Delivery(15.09.2026 um 21:55 Uhr)
🔧 ProgrammierungUAJY Handbook RAG Chatbot Splits FAISS Search From Gemini(15.09.2026 um 21:55 Uhr)
🔧 ProgrammierungKnowledge Base For AI Agents: What It Must Do(15.09.2026 um 22:00 Uhr)
🕵️ SicherheitslückenCVE-2026-58728 | Google Android ARM64 MMU mmu.h ARM64_TLBI race condition(15.09.2026 um 21:40 Uhr)
🔧 ProgrammierungEnforce GitHub Advanced Security configurations(15.09.2026 um 21:31 Uhr)
🔧 ProgrammierungHow i give my coding agent a map of the repo with Empryo(15.09.2026 um 21:54 Uhr)
🔧 ProgrammierungReef Connects Agent Feedback, Learning and Versioned Delivery(15.09.2026 um 21:55 Uhr)
🔧 ProgrammierungUAJY Handbook RAG Chatbot Splits FAISS Search From Gemini(15.09.2026 um 21:55 Uhr)
🔧 ProgrammierungKnowledge Base For AI Agents: What It Must Do(15.09.2026 um 22:00 Uhr)

🔧 Programmierung 🕛 vor 3 Monaten 2 Min Lesezeit
0

🏷️ DAY 5: Dictionaries

↗ Quelle (dev.to)
🗣️ Stimme:

Welcome back, Pythonistas! 🚀 For the last two days, we’ve been using indices like 0, 1, and 2 to grab items out of our lists and tuples. But let’s be real—if you’re building an RPG game and want to find a character's "stamina", nobody wants to guess whether that's stored at index 4 or index 7.



Today, we are throwing numerical indices out the window and upgrading to custom labels. Imagine a massive chest of drawers where you get to write the labels on the outside yourself.



Enter Dictionaries! 🏷️📖






📖 What is a Dictionary?



In Python, a Dictionary is a collection of key-value pairs. Instead of looking up items by a number, you look them up using a unique word (the Key) to get the data attached to it (the Value).



To make a dictionary, we use curly braces {}, and we separate keys and values with a colon :




CODE
# Creating our character's stat sheet 🎮
character = {
"name": "Anya",
"role": "Mage",
"level": 14,
"is_premium": True
}

print(character)









🔍 Reading data with Custom Labels



To pull data out, you use the exact same square bracket setup we used for lists, but instead of a number, you pass in the exact string key:




CODE
# Checking Anya's role
print(character["role"]) # Prints: Mage

# Checking Anya's level
print(character["level"]) # Prints: 14






⚠️ Tantrum Alert: Python keys are case-sensitive! If you try to look up character["Role"] with a capital R, Python will throw a KeyError and pretend it has never seen that data in its life.






🛠️ Modifying the Chest of Drawers



Dictionaries are completely mutable (flexible). You can change values, add new drawers, or rip drawers out completely.




CODE
# 1. Updating a value (Anya leveled up! 🎉)
character["level"] = 15

# 2. Adding a brand new key-value pair
character["weapon"] = "Crystal Staff"

# 3. Deleting a key-value pair 🗑️
del character["is_premium"]

print(character)
# Output: {'name': 'Anya', 'role': 'Mage', 'level': 15, 'weapon': 'Crystal Staff'}






🚀 Today's Challenge 🏆

Create a dictionary called my_car with the keys: brand, model, and year.



Print out the model of your car.



Update the year to a newer one (or change it to a hovercar from the future 🚀).



Add a new key called color and give it a value.



Drop your custom dictionary in the comments below! Tomorrow, we are finishing our core data structures by looking at Sets—the ultimate bouncers of the Python world! 🎟️

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
3 Quellen
CVE-2026-58728 | Google Android ARM64 MMU mmu.h ARM64_TLBI race condition
1 Quelle
DFN-CERT-2026-4853 Xcode: Eine Schwachstelle ermöglicht das Ausspähen von Informationen
1 Quelle
Enforce GitHub Advanced Security configurations
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten 🏷️ DAY 5: Dictionaries

Thematisch verwandte Begriffe: Dictionaries · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...