pub-3785248829033902 | Python: Dictionary Functions | - Big data with Python

| Python: Dictionary Functions |

Just like lists, dictionary keys can be assigned to different values.

However, unlike lists, a new dictionary key can also be assigned a value, not just ones that already exist.

The best way to learn new things is to take a practical approach of the things you want to learn. Here is a fragment of code that demonstrates the use of dictionary statement in Python:

Æ’ python command

i = {1: "one", 2: "two", 3: "three"}
print(1 in i)
print("three" in i)
print(4 not in i)

output

True
False
True



Previous
Next Post »