Inkhmer LogoInKhmerBuilding the digital future
  • About
  • Projects
  • Blog
  • Tools
  • Learn
  • Contact
KMខ្មែរENEnglish

InKhmer.com — a personal Khmer Digital Hub curated by our team. Tools, Cambodia resources, Khmer culture, and digital projects. Practical, approachable, and built for everyone.

Social

FacebookTelegram

Quick Links

  • About
  • Projects
  • Blog
  • Tools
  • Learn
  • Contact

Explore

  • What We Build
  • How We Build
  • Roadmap
  • Experiments
  • Sitemap

Subscribe to our newsletter

Get the latest updates about Cambodia, new tools, and exclusive content delivered to your inbox.

  • Terms of Service
  • Privacy Policy
  • Cookie Policy

© 2026 InKhmer. All rights reserved.

LearnPython for AI and Data in KhmerLists and dicts

Lists and dicts

Daily data work is lists and pairs: a list of products, a list of prices, name–price pairs. Python has two tools: list and dict.

List = an ordered list:

prices = [20000, 12000, 8000]
prices[0]        # 20000 — counting starts at 0
len(prices)      # 3
prices.append(15000)   # add

Dict = name→value pairs:

product = {"name": "ម្ហូបក្រៀម", "price_khr": 20000, "stock": 45}
product["price_khr"]   # 20000
product["stock"]       # 45

A common shape: a list of dicts — like a table:

rows = [
  {"province": "សៀមរាប", "pop": 1000},
  {"province": "បាត់ដំបង", "pop": 990},
]
rows[1]["province"]   # បាត់ដំបង

This is the same structure pandas uses later.

Takeaways:

  • List = ordered, starts at 0; dict = name→value pairs
  • A list of dicts = a natural table
  • len(), append(), [] — the basic operations

Sign in to start tracking from this lesson