<filename>example8_dict.py
# -*- coding: utf-8 -*-
# An empty dict
a = {}

# Result: None
print a.get("abc")

# Add a value to the dict
a["abc"] = 5

# Result: 5
print a.get("abc")

# Add another value
a[16] = "A text"

# Result: A text
print a.get(16)

# The whole dict {16: 'A text', 'abc': 5}
print a


# You can add content when creating the dict
b = {"ccc": "f", 16: 165}

# You can put dicts in a list
a_list = [a, b]

# Result: [{16: 'En text', 'abc': 5}, {16: 165, 'ccc': 'f'}]
print a_list


<filename>example8_dict.py
# -*- coding: utf-8 -*-
# An empty dict
a = {}

# Result: None
print a.get("abc")

# Add a value to the dict
a["abc"] = 5

# Result: 5
print a.get("abc")

# Add another value
a[16] = "A text"

# Result: A text
print a.get(16)

# The whole dict {16: 'A text', 'abc': 5}
print a


# You can add content when creating the dict
b = {"ccc": "f", 16: 165}

# You can put dicts in a list
a_list = [a, b]

# Result: [{16: 'En text', 'abc': 5}, {16: 165, 'ccc': 'f'}]
print a_list


# -*- coding: utf-8 -*- # An empty dict # Result: None # Add a value to the dict # Result: 5 # Add another value # Result: A text # The whole dict {16: 'A text', 'abc': 5} # You can add content when creating the dict # You can put dicts in a list # Result: [{16: 'En text', 'abc': 5}, {16: 165, 'ccc': 'f'}]