python oop instance variables code example
Example 1: what is a ython instance
An object belonging to a class. e.g. if you had an Employee class, each
individual employee would be an instance of the Employee class
Example 2: class python
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
p1 = Person("John", 36)
p1.age = 40
print(p1.age)
---------------------------------------------------------------
40