-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathogrenci_kayit_programi.py
More file actions
72 lines (58 loc) · 1.82 KB
/
ogrenci_kayit_programi.py
File metadata and controls
72 lines (58 loc) · 1.82 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
def not_hesapla(satir):
satir = satir[:-1]
liste = satir.split(":")
ogrenciAdi = liste[0]
notlar = liste[1].split(",")
not1 = int(notlar[0])
not2 = int(notlar[1])
not3 = int(notlar[2])
ortalama = (not1+not2+not3)/3
if ortalama >= 90 and ortalama <= 100:
harf = "AA"
elif ortalama >= 85 and ortalama <= 89:
harf = "BA"
elif ortalama >= 80 and ortalama <= 84:
harf = "BB"
elif ortalama >= 75 and ortalama <= 79:
harf = "CB"
elif ortalama >= 70 and ortalama <= 74:
harf = "CC"
elif ortalama >= 65 and ortalama <= 69:
harf = "DC"
elif ortalama >= 60 and ortalama <= 64:
harf = "DD"
elif ortalama >= 50 and ortalama <= 59:
harf = "FD"
else:
harf = "FF"
return ogrenciAdi + ": " + harf + "\n"
def ortalamalari_oku():
with open("sinav_notlari.txt","r",encoding="utf-8") as file:
for satir in file:
print(not_hesapla(satir))
def not_gir():
ad = input("Öğrenci adı: ")
soyad = input("Öğrenci soyadı: ")
not1 = input("Not1: ")
not2 = input("Not2: ")
not3 = input("Not3: ")
with open("sinav_notlari.txt","a",encoding="utf-8") as file:
file.write(ad+" "+ soyad+ ":"+not1+","+not2+","+not3+"\n")
def notlari_kayitEt():
with open("sinav_notlari.txt","r",encoding="utf-8") as file:
liste = []
for i in file:
liste.append(not_hesapla(i))
with open("sonuclar.txt","w",encoding="utf-8") as file2:
for i in liste:
file2.write(i)
while True:
islem = input("1- Notları oku\n2- Not gir \n3- Notları kayıt et\n4- Çıkış \n")
if islem == "1":
ortalamalari_oku()
elif islem == "2":
not_gir()
elif islem == "3":
notlari_kayitEt()
else:
pass