Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Class In Python With Instance Method

class Car:
    def __init__(self, name):
        self.name = name
        
    
    
    def sound(self):
        return "Vroooom!"
ferrari = Car("ferrari")
print(ferrari.sound()) 
 
PREVIOUS NEXT
Tagged: #Class #In #Python #With #Instance #Method
ADD COMMENT
Topic
Name
8+6 =