Working with Dictionaries
Dictionaries store data as key-value pairs, like a real dictionary where you look up a word (key) to find its definition (value). They're perfect for financial data where you want to associate values with meaningful labels.
Creating Dictionaries
جارٍ تحميل ساحة تجربة Python...
Accessing Dictionary Values
Use keys to retrieve values:
جارٍ تحميل ساحة تجربة Python...
Modifying Dictionaries
جارٍ تحميل ساحة تجربة Python...
Useful Dictionary Methods
جارٍ تحميل ساحة تجربة Python...
Nested Dictionaries
Dictionaries can contain other dictionaries - perfect for portfolios:
جارٍ تحميل ساحة تجربة Python...
Looping Through Dictionaries
جارٍ تحميل ساحة تجربة Python...
Practice: Create a Stock Dictionary
جارٍ تحميل تمرين Python...
Practice: Calculate Gain/Loss
جارٍ تحميل تمرين Python...
Key Takeaways
- Dictionaries store data as
{key: value}pairs - Access values with
dict['key']ordict.get('key') - Use
.get()with a default value to avoid errors - Add/update values with
dict['key'] = value - Delete with
del dict['key'] - Loop with
for key, value in dict.items() - Dictionaries can be nested for complex data structures
- Perfect for storing labeled financial data
Next, we'll put it all together and build your first financial calculator!
التالي · الدرس 7 من 26
Your First Financial Calculator
قراءة 2 دقيقة
أنهيت 6 من 26 درسًا

اسأل Byte عن هذا الدرس
محادثة خاصة حول هذا الدرس. قرأ Byte الدرس كاملًا، ويجيب خلال ثوانٍ، ويُظهر القسم الذي تأتي منه كل إجابة. يمكنك السؤال بأي لغة.
الأسئلة والأجوبة
أسئلة عامة حول هذا الدرس. يجيب AI Tutor فورًا بلغتك، ويراجع فريق FreeAcademy الإجابات، ويمكن لكل المتعلمين قراءتها.

