-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path5_notHesaplama.py
More file actions
55 lines (51 loc) · 1.62 KB
/
5_notHesaplama.py
File metadata and controls
55 lines (51 loc) · 1.62 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
def ort_Hesapla(satir):
satir = satir[:-1]
seciliNotlar = satir.split(":")
ogrenciAdi = seciliNotlar[0]
notlar = seciliNotlar[1]
notlar = notlar.split(",")
not1 = notlar[0]
not2 = notlar[1]
not3 = notlar[2]
ortalama = (int(not1)+int(not2)+int(not3))/3
if ortalama>=90 and ortalama<=100:
harf = "AA"
elif ortalama>=85 and ortalama<=89:
harf = "BB"
elif ortalama>=65:
harf = "CC"
else:
harf = "FF"
return ogrenciAdi + ": " + harf + "\n"
def notlari_kayitet():
with open("sinav_notlari.txt", "a+", encoding="utf-8") as dosya:
liste = []
for i in dosya:
liste.append(ort_Hesapla(i))
with open("sonuclar.txt", "w+", encoding='utf-8') as dosya2:
for t in dosya2:
dosya2.writelines(t)
print(dosya2.writelines(t))
def not_gir():
isim = input("->İsim: ")
soyisim = input("->Soy isim: ")
not1 = input("->1. Not: ")
not2 = input("->2. Not: ")
not3 = input("->3. Not: ")
print("\n")
with open("sinav_notlari.txt", "a", encoding='utf-8') as kayitKismi:
kayitKismi.write(isim+" "+ soyisim+":"+not1+","+not2+","+not3+"\n")
def ortamalari_oku():
with open("sinav_notlari.txt", "a+", encoding='utf-8') as ortOku:
for satir in ortOku:
print(ort_Hesapla(satir))
while True:
islem = input("> 1- Notları Oku\n> 2- Not Gir\n> 3- Notları Kayıt Et\n# 4- Çıkış\n-> ")
if islem == "1":
ortamalari_oku()
elif islem == "2":
not_gir()
elif islem == "3":
notlari_kayitet()
else:
break