create a object of class in python code example
Example 1: python class
class Dog(object):
def __init__(self, name, age):
self.name = name
self.age = age
def speak(self):
print("Hi I'm ", self.name, 'and I am', self.age, 'Years Old')
JUB0T = Dog('JUB0T', 55)
Friend = Dog('Doge', 10)
JUB0T.speak()
Friend.speak()
Example 2: how to use class's in python
class person:
name = "jake"
age = 13
x = vars(person)
print(x)