scientific_comp_projects/CODE/[python]object_oriented(tech_with_tim)/animals.py
2021-10-29 15:16:40 +02:00

19 lines
253 B
Python

class Dog:
def __init__(self,name):
self.name = name
print(name)
def add_one(self,x):
return x+1
def bark(self):
print("bark")
d = Dog('Tim')
d2 = Dog('Billy')
d.bark()
print(d.add_one(5))
print(type(d))