-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompany.py
More file actions
37 lines (26 loc) · 678 Bytes
/
company.py
File metadata and controls
37 lines (26 loc) · 678 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
29
30
31
32
33
34
35
36
37
class Person:
name = "NULL"
def __init__(self):
self.name = ""
self.address = ""
self.phonenumber = ""
self.id = ""
def addname(self, name):
self.name = name
def addaddress(self, addr):
self.address = addr
def phone(self, phonenumber):
self.phonenumber = phonenumber
def Printdetails(self):
print(f"Name -> {self.name}")
print(f"Address -> {self.address}")
print(f"Phone -> {self.phonenumber}")
p1 = Person()
p1.phone("98234134")
p1.addaddress("Ktm")
p1.addname("sahil")
p2 = Person()
p2.phone("2341243")
p2.addaddress("BTM")
p2.addname("Hari")
p2.Printdetails()