-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclasses_refresher.py
More file actions
46 lines (33 loc) · 1.32 KB
/
Copy pathclasses_refresher.py
File metadata and controls
46 lines (33 loc) · 1.32 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
class Employee:
def __init__ (self, employee_name, employee_id):
self.employee_name=employee_name
self.employee_id=employee_id
class Qualification:
def __init__ (self, degree):
self.degree=degree
class Scientist(Employee, Qualification):
def __init__(self, employee_name, employee_id, degree, designation):
Employee.__init__(self, employee_name, employee_id)
Qualification.__init__(self, degree)
self.designation=designation
def display_sci_details(self):
print(f"Scientist details\nName:{self.employee_name}\nID:{self.employee_id}\nDegree:{self.degree}\nDesignation:{self.designation}")
sci1=Scientist("Henry","0098", "Btech+AI_ML", "Lead Engineer_Research and Development Division" )
sci1.display_sci_details()
# import math
# class Circle:
# def __init__ (self, radius):
# self.radius=radius
# def display_properties(self):
# area=math.pi*self.radius**2
# print(f"Area of circle: {area}")
# c1=Circle(float(input("Enter radius of circle: ")))
# c1.display_properties()
# class Person:
# def __init__ (self, name, age):
# self.name=name
# self.age=age
# def display_details(self):
# print(f"Name: {self.name}\nAge: {self.age}")
# person1=Person("Henry", "21")
# person1.display_details()