Intro

Class with Attributes and Methods

Typically, classes include an init() method, which is a special “constructor” method that runs every time a new object is created. This method is used to initialize instance attributes (data unique to each object). All methods within a class must accept at least one argument, conventionally named self, which refers to the specific instance of the class.

https://www.w3schools.com/python/python_class_init.asp

class Person:
  def __init__(self, name, age):
    self.name = name
    self.age = age
 
p1 = Person("Emil", 36)
 
print(p1.name)
print(p1.age) 

Resources