-
Notifications
You must be signed in to change notification settings - Fork 0
/
revisingclasses.py
37 lines (21 loc) · 908 Bytes
/
revisingclasses.py
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
class employee:
age = 0
number_of_students = 0
def __init__(self,name,town,dob,university):
self.name = name
self.town = town
self.dob = dob
self.university = university
self.twitter = "twitter.com/ombogomayaka"
number_of_students += 1
added = number_of_students
def age (self):
employee.age = 2023 - self.dob
return employee.age
input_name = str(input("Enter your name: "))
input_town = str(input("Enter your town: "))
input_dob = int(input("Enter your dob: "))
input_uni = str(input("Enter your university: "))
employee1 = employee(input_name,input_town,input_dob,input_uni)
print(f"the name of the employee is {employee1.name} the come from {employee1.town} they are aged {employee1.age()} and they studied in {employee1.university}")
print(employee.number_of_students)