-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCircle.py
More file actions
65 lines (44 loc) · 1.4 KB
/
Circle.py
File metadata and controls
65 lines (44 loc) · 1.4 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
#!"C:\Phython\python.exe"
"""Circle.py, by yukthika,2017
This program is the first phython
"""
class Circle(object):
def __init__(self):
super(Circle, self).__init__()class Circle(object):
self._radius = 0.0
self._NoofCircleCreated++
@property
def radius(self):
"""I'm the Radius property.getter"""
return self._radius
@radius.setter
def radius(self, value):
"""I'm the Radius property.setter"""
self._radius = value
@radius.deleter
def radius(self):
"""I'm the Radius property deleter"""
del self._radius
@property
def NoofCircleCreated(self):
return self._NoofCircleCreated
@property
def Area():
return math.pi * radius * radius
@property
def Perimeter():
return math.pi * radius * 2
# main function
if __name__ == "__main__":
"""
Main function
"""
C1 =Circle()
print(C1.self._radius )
print(C!.self._NoofCircleCreated)
C2 =Circle()
print(C2.self._radius )
print(C2.self._NoofCircleCreated)
C3 =Circle()
print(C3.self._radius )
print(C3.self._NoofCircleCreated)