Split String into List using split() :

a = "Hello, World!"
print(a.split(","))  # Splits the string at comma and returns a list

Output :

['Hello', ' World!']

Dictionary Length :

thisdict = {
  "brand": "Ford",
  "model": "Mustang",
  "year": 1964
}
print(len(thisdict))  # Prints number of items in the dictionary

Output :

3

Dictionary with Various Data Types :

thisdict = {
  "brand": "Ford",
  "electric": False,
  "year": 1964,
  "colors": ["red", "white", "blue"]
}

Print Dictionary Type :

thisdict = {
  "brand": "Ford",
  "model": "Mustang",
  "year": 1964
}
print(type(thisdict))  # Output: <class 'dict'>

Output :

<class 'dict'>

Access Dictionary Item Using Key :

thisdict = {
  "brand": "Ford",
  "model": "Mustang",
  "year": 1964
}
x = thisdict["model"]
print(x)

Output :

Mustang

Access Dictionary Item Using get() :

x = thisdict.get("model")
print(x)

Output :

Mustang