Python Programming/Dictionaries

A dictionary in Python is a collection of unordered values accessed by key rather than by index. The keys have to be hashable: integers, floating point numbers, strings, tuples, and, frozensets are hashable. Lists, dictionaries, and sets other than frozensets are not hashable. Dictionaries were available as early as in Python 1.4.

Overview
Dictionaries in Python at a glance:

Dictionary notation
Dictionaries may be created directly or converted from sequences. Dictionaries are enclosed in curly braces, {}

Also, dictionaries can be easily created by zipping two sequences.

Operations on Dictionaries
The operations on dictionaries are somewhat unique. Slicing is not supported, since the items have no intrinsic order.

Combining two Dictionaries
You can combine two dictionaries by using the update method of the primary dictionary. Note that the update method will merge existing elements if they conflict.

Exercises
Write a program that:
 * 1) Asks the user for a string, then creates the following dictionary. The values are the letters in the string, with the corresponding key being the place in the string. https://docs.python.org/2/tutorial/datastructures.html#looping-techniques
 * 2) Replaces the entry whose key is the integer 3, with the value "Pie".
 * 3) Asks the user for a string of digits, then prints out the values corresponding to those digits.