Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- harf=['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
- dosya=open("p022_names.txt","r")
- metin=dosya.read()
- liste=re.findall('"(.*?)"',metin)
- liste.sort()
- def isim_toplam(isim):
- toplam=0
- for i in isim:
- toplam+=harf.index(i)+1
- return toplam
- genel_toplam=0
- for i in range(len(liste)):
- genel_toplam+=(isim_toplam(liste[i])*(i+1))
Add Comment
Please, Sign In to add comment