19 lines
253 B
Python
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))
|