- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoops2.py
More file actions
Latest commit
28 lines (20 loc) · 676 Bytes
/
Copy pathoops2.py
File metadata and controls
28 lines (20 loc) · 676 Bytes
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
classUniversity:
univ_name='Mumbai University'#class attribute
def__init__(self, student_id, student_name, student_branch):
self.id=student_id
self.name=student_name
self.branch=student_branch
student1=University(2, 'Rakesh', 'Arts')
print(student1.id, student1.name, student1.branch)
print("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<")
classCircle:
def__init__(self,colo_r,radiu_s):
self.color=colo_r
self.radius=radiu_s
defcompute_area(self):
self.area=3.14*self.radius*self.radius
circle1=Circle('red', 5)
circle2=Circle('green', 10)
circle1.compute_area()
circle2.compute_area()
print("ans is", circle1.area, circle2.area)