Answers for "python __class_ does what?"

1

what is a class in python

Classes are blueprint used to construct objects
Posted by: Guest on September-07-2021
0

how to use a class in python

class awwab(object):
    def __init__(self, name, age):
        self.name = name
        self.age = age
    
    def speak(self):
        print("Hello, my name is",self.name,"and I am",self.age,"years old!")
        
awwabasad = awwab("Awwab Asad", 11)
print(awwabasad.speak())
Posted by: Guest on July-31-2021

Python Answers by Framework

Browse Popular Code Answers by Language