- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.py
More file actions
Latest commit
18 lines (16 loc) · 481 Bytes
/
Copy pathinit.py
File metadata and controls
18 lines (16 loc) · 481 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
classperson:
def__init__(self, name, age, nama_lawan):
self.name=name
self.age=age
self.nama_lawan=nama_lawan
defsapa(self):
print("Halo, namaku "+self.name)
print("Namamu siapa?")
defsalamkenal(self):
print("Salam Kenal "+self.nama_lawan)
print("Senang bertemu denganmu, sampai jumpa!")
# p1 = person("Nafi", 22)
# p2 = person("Dodit", 21)
p1=person("Nafi", 22, "Dodit")
p1.sapa()
p1.salamkenal()