Untitled
unknown
plain_text
a year ago
1.2 kB
4
Indexable
with open("21_ogrenciler.txt") as f:
with open("21_gecenler.txt", "w") as g:
with open("21_kalanlar.txt", "w") as k:
icerik = f.readlines()
m = 0
for satir in icerik:
if m == 0 :
m += 1
continue
satir = satir.replace("\n","")
bosluk_sayisi = 0
bosluk_indexleri = [1]
index = 0
for karakter in satir:
if karakter == "":
bosluk_sayisi += 1
bosluk_indexleri.append(index)
index += 1
ad_soyad = satir[:bosluk_indexleri[0]]
soyad = ad_soyad.split("-")[-1]
ad = ad_soyad[:ad_soyad.index(soyad) - 1].replace("-", "")
notlar = satir.split("-")[-1]
notlar = notlar.split("/")
birinci_vize = int(notlar[0])
ikinci_vize = int(notlar[1])
final = int(notlar[2])
ortalama = birinci_vize * 0.3 + ikinci_vize * 0.3 + final * 0.4
print(ortalama)
Editor is loading...
Leave a Comment