-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtelp.py
More file actions
31 lines (27 loc) · 747 Bytes
/
telp.py
File metadata and controls
31 lines (27 loc) · 747 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
# Definisikan fungsi
def pembuka():
print("PROGRAM PENCATAT KONTAK")
print("\nSelamat Datang!\n")
f = open("kontak.txt", "w")
f.write("KONTAK SAYA\n")
f.close()
def menu():
print("---------------------------")
print("---Menu---")
print(" 1. Daftar Kontak\n 2. Tambah Kontak\n 3. Keluar")
print("---------------------------\n")
def tampil_kontak():
f = open("kontak.txt", "r")
print(f.read())
f.close()
def tambah_kontak():
f = open("kontak.txt", "a")
f.write(input("Nama : "))
f.write("\n")
f.write(input("No Telepon : "))
f.write("\n")
f.write("\n")
f.close()
print("\nKontak Berhasil Ditambahkan!\n")
def penutup():
print("Program Selesai, sampai jumpa!\n")