Python
100 ~30 dk

List ve Dict Uygulamaları

Proje 1: Not Defteri

notlar = {}

while True:
    print("\n1. Not Ekle  2. Notları Gör  3. Not Ara  4. Çıkış")
    secim = input("Seçim: ")
    
    if secim == "1":
        baslik = input("Başlık: ")
        icerik = input("İçerik: ")
        notlar[baslik] = icerik
        print("✅ Not eklendi!")
    elif secim == "2":
        for b, i in notlar.items():
            print(f"📝 {b}: {i}")
    elif secim == "3":
        arama = input("Aranacak kelime: ")
        sonuclar = {b: i for b, i in notlar.items() if arama.lower() in b.lower() or arama.lower() in i.lower()}
        for b, i in sonuclar.items():
            print(f"🔍 {b}: {i}")
    elif secim == "4":
        break

Proje 2: Öğrenci Yönetim Sistemi

ogrenciler = []

def ogrenci_ekle():
    ad = input("Ad: ")
    numara = input("Numara: ")
    notlar = []
    while True:
        not_ = input("Not (bitirmek için 'q'): ")
        if not_ == 'q': break
        notlar.append(float(not_))
    ogrenciler.append({"ad": ad, "numara": numara, "notlar": notlar})
    print("✅ Öğrenci eklendi!")

def listele():
    for ogr in sorted(ogrenciler, key=lambda x: sum(x["notlar"])/len(x["notlar"]) if x["notlar"] else 0, reverse=True):
        ort = sum(ogr["notlar"]) / len(ogr["notlar"]) if ogr["notlar"] else 0
        durum = "Geçti ✅" if ort >= 50 else "Kaldı ❌"
        print(f"{ogr['numara']} - {ogr['ad']} - Ort: {ort:.1f} - {durum}")

🎯 Alıştırmalar

  1. Alışveriş listesi uygulaması (ekleme, silme, toplam fiyat)
  2. Kelime sayacı: Bir metindeki her kelimenin kaç kez geçtiğini bulan program

Yorumlar 0

Giriş yapın — Yorumlarınız hemen yayınlansın
Henüz yorum yapılmamış. İlk yorumu siz yapın!