Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python class

class Car():
    def __init__(self, _name, _year):
        self.name = _name
        self.age = _age

    def start(self):
        print("starting...")
        
    def drive(self):
    	print("Vroom Vroom!")

myCar = Car('Audi', 2019)
myCar.start()
myCar.drive()
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #python #class
ADD COMMENT
Topic
Name
4+7 =