Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create 5.hafta çözümü.py #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions 5.hafta çözümü.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Telefon_Rehberi = "1 - Yeni Kisi Ekleme\n2 - Kisi Duzenleme\n3 - Kisi silme\n4 - Kisi arama"

def kisi_ekleme():
isim = input("AD:").capitalize()
numara = input("NUMARA:")
rehber[isim] = numara

def kisi_duzenle():
kisi = input("KISI ADI:").capitalize()
if kisi in rehber:
# print(rehber.items(kisi))
duzenle = input("ISIM DUZENLEMEK ICIN -> 'I'\nNUMARA DUZENLEMEK ICIN -> 'N'\nKISIYI SILMEK ICIN -> 'S' ").upper()
if duzenle == "I":
yeni_isim = input("YENI ISIM:").capitalize()
rehber[yeni_isim] = rehber.pop(kisi)
elif duzenle == "N":
yeni_numara = input("YENI NUMARA:")
rehber[kisi] = yeni_numara
elif duzenle == "S":
kisi_silme()
else:
print("ARADIGINIZ KISI BULUNAMADI!")


def kisi_silme():
sil = input("SILMEK ISTEDIGINIZ KISI ADINI YAZIN:").capitalize()
sor = input("EMIN MISIN: E/ H").upper()
if sor == "E":
rehber.pop(sil)
elif sor == "H":
print("SILME ISLEMI IPTAL EDILDI!")

def kisi_arama():
ara = input("ARADIGINIZ KISI:").capitalize()
if ara in rehber:
print("NUMARASI:",rehber.get(ara))
else:
print("BULUNAMADI!")

rehber = {}
while True:
print("Hosgeldiniz")
print("Cikis icin -> 'q'")
print(Telefon_Rehberi)
secim = input("Bir islem seciniz:")

if secim == "q":
break
elif secim == "1":
kisi_ekleme()
elif secim == "2":
kisi_duzenle()
elif secim == "3":
kisi_silme()
elif secim == "4":
kisi_arama()
else:
print("HATALI GIRIS! TEKRAR DENEYIN.")

print(20*"-")
print("MEVCUT REHBERINIZ:")
print(rehber)
print(20*"-")