How to make a class and object in python

 class Person:

    def __init__(self, name, age):
self.name = name
self.age = age


p1 = Person("Prashant", 28)

print(p1.name)
print(p1.age)

Comments

Popular posts from this blog

Guess game!

Path for chromedriver