-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtriangle.py
More file actions
72 lines (60 loc) · 1.87 KB
/
Copy pathtriangle.py
File metadata and controls
72 lines (60 loc) · 1.87 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
67
68
69
70
71
72
class Triangle:
def __init__(self,AB,BC,AC):
self.AB=int(AB)
self.BC=int(BC)
self.AC=int(AC)
def isset(self):
if (self.AB+self.BC) < (self.AC):
return False
elif (self.AB+self.AC) < (self.BC):
return False
elif (self.AC+self.BC) < (self.AB):
return False
else:
return True
def maximum(self):
if self.isset():
maxi=max(self.AB,self.BC,self.AC)
return int(maxi)
def perim(self):
if self.isset():
return self.AB+self.BC+self.AC
else:
return None
def equil(self):
if self.isset():
if self.AB==self.BC and self.AB==self.AC:
return True
else:
return False
else:
return False
def iso(self):
if self.isset():
if self.AB==self.BC or self.AB==self.AC or self.BC==self.AC:
return True
else:
return False
else:
return False
# def rect(self):
# if self.isset():
# maxi=max(self.AB,self.BC,self.AC)
# if maxi==self.AB:
# pow=self.BC*self.BC+self.AC*self.AC
# if pow == self.AB*self.AB:
# return True
# elif maxi==self.BC:
# pow=self.AB*self.AB+self.AC*self.AC
# if pow==self.BC*self.BC:
# return True
# elif maxi==self.AC:
# pow=self.BC*self.BC+self.AB*self.AB
# if pow == self.AC*self.AC:
# return True
# else:
# return False
# else:
# return False
tri=Triangle(2,2,4)
print(tri.equil())