-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass__pass.py
More file actions
66 lines (50 loc) · 1.03 KB
/
class__pass.py
File metadata and controls
66 lines (50 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 20 20:55:35 2019
@author: Robot
"""
class Things:
pass
class Animate(Things):
pass
class Animals(Animate):
def breathe(self):
print('breathing')
def move(self):
print('moving')
def eat_food(self):
print('eating food')
class Mammals(Animals):
pass
class Pandas(Mammals):
pass
class Giraffes(Mammals):
pass
class Inanimate(Things):
pass
class Sidewalks(Inanimate):
pass
class MyMath:
def Add(self,a,b):
return a+b
def Minus(self,a,b):
return a-b
def Div(self,a,b):
if b == 0:
print("Error, 0")
return 0
return a/b
if __name__ == '__main__':
myMath = MyMath()
res = myMath.Add(10,20)
print(res)
res = myMath.Minus(20,10)
print(res)
res = myMath.Div(10,2)
print(res)
'''
ani = Animals()
ani.breathe()
ani.eat_food()
ani.move()
'''