DICTIONARIES
Accessing Values
print(person["name"]) # Rahul
print(person["age"]) # 25
Adding / Updating Items
person["email"] = "rahul@[Link]" # add new key
person["age"] = 26 # update existing key
print(person)
# {'name': 'Rahul', 'age': 26, 'city': 'Delhi', 'email': 'rahul@[Link]'}
NOTE - double quotes inside double quotes in the f-string.
Python gets confused where the string starts/ends.
print(f"Car model: {[Link]('model')}")
CLASSES
It is user defined blueprint or prototype
class contains variable and methods. the same variable and method are also
available in the object because they
are created inside the instances
NOTE - The diff bw function and method. A function written inside a class is called
method
Generally method is called by the following two ways
1. [Link]()
[Link]()