Akis Forum

Welcome to AkisForum.com! Register your free account today and become a member! Once signed in, you'll be able to dive into learning to code, discovering new tools, and keeping up with the latest trends. AkisForum is where benefit, knowledge, and sharing come together. Join us to add your own topics and posts, and connect with other members through your private inbox!

Python 🎓 BASİT ÖĞRENCİ YÖNETİM SİSTEMİ

sefack

Member
Akisor
Öğrenci bilgilerini kaydeden, listeleyen, arayan ve dosyadan okuma/yazma yapan bir sistem.

📜 ÖZELLİKLERİ​

✔️ JSON dosyasına kayıt (Veriler kalıcı olarak saklanır)
✔️ Öğrenci ekleme/listeleme/arama
✔️ Not ortalaması hesaplama
✔️ Hata yönetimi (Basit seviyede)


📌 KURULUM​

  1. Kodu ogrenci_sistemi.py olarak kaydedin.
  2. Terminalde python ogrenci_sistemi.py ile çalıştırın.



  3. Python:
    import json
    import os
    
    DOSYA_ADI = "ogrenciler.json"
    
    def dosyadan_oku():
        if os.path.exists(DOSYA_ADI):
            with open(DOSYA_ADI, "r", encoding="utf-8") as dosya:
                return json.load(dosya)
        return {}
    
    def dosyaya_yaz(veri):
        with open(DOSYA_ADI, "w", encoding="utf-8") as dosya:
            json.dump(veri, dosya, indent=4, ensure_ascii=False)
    
    def ogrenci_ekle():
        ad = input("Öğrenci adı: ")
        numara = input("Öğrenci numarası: ")
        notlar = input("Notları (virgülle ayırın): ").split(",")
        
        ogrenciler = dosyadan_oku()
        ogrenciler[numara] = {
            "ad": ad,
            "notlar": [int(notu.strip()) for notu in notlar]
        }
        dosyaya_yaz(ogrenciler)
        print(f"\n✅ {ad} ({numara}) başarıyla eklendi!\n")
    
    def ogrenci_listele():
        ogrenciler = dosyadan_oku()
        if not ogrenciler:
            print("\n❌ Kayıtlı öğrenci yok!\n")
            return
        
        print("\n📋 ÖĞRENCİ LİSTESİ")
        for numara, bilgiler in ogrenciler.items():
            ortalama = sum(bilgiler["notlar"]) / len(bilgiler["notlar"])
            print(f"├─ {numara}: {bilgiler['ad']} (Ortalama: {ortalama:.1f})")
    
    def ogrenci_ara():
        arama = input("Aranacak öğrenci adı/numarası: ").lower()
        ogrenciler = dosyadan_oku()
        bulunan = False
        
        for numara, bilgiler in ogrenciler.items():
            if arama in numara or arama in bilgiler["ad"].lower():
                print(f"\n🔍 Bulunan: {bilgiler['ad']} ({numara})")
                print(f"   Notlar: {', '.join(map(str, bilgiler['notlar']))}")
                bulunan = True
        
        if not bulunan:
            print("\n❌ Öğrenci bulunamadı!")
    
    def main():
        while True:
            print("\n" + "="*30)
            print("1️⃣ Öğrenci Ekle")
            print("2️⃣ Tüm Öğrencileri Listele")
            print("3️⃣ Öğrenci Ara")
            print("4️⃣ Çıkış")
            print("="*30)
            
            secim = input("Seçiminiz (1-4): ")
            
            if secim == "1":
                ogrenci_ekle()
            elif secim == "2":
                ogrenci_listele()
            elif secim == "3":
                ogrenci_ara()
            elif secim == "4":
                print("\nÇıkış yapılıyor...")
                break
            else:
                print("\n❌ Geçersiz seçim!")
    
    if __name__ == "__main__":
        main()
 
Son düzenleme:
Geri
Üst