Overview:
The python dictionary keys can be taken from an iterable object and initialized with a value for each of the keys.
Example 1:
# Example Python program that creates # All roads lead to Rome |
Output:
{'Road1': 'Rome', 'Road2': 'Rome', 'Road3': 'Rome', 'Road4': 'Rome', 'Road5': 'Rome'} |
Example 2:
# Example Python program that creates a dictionary |
Output:
Dictionary: |