Guest User

Untitled

a guest
May 22nd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import re
  2. 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']
  3.  
  4.  
  5. dosya=open("p022_names.txt","r")
  6. metin=dosya.read()
  7.  
  8. liste=re.findall('"(.*?)"',metin)
  9. liste.sort()
  10.  
  11. def isim_toplam(isim):
  12. toplam=0
  13. for i in isim:
  14. toplam+=harf.index(i)+1
  15. return toplam
  16.  
  17. genel_toplam=0
  18. for i in range(len(liste)):
  19. genel_toplam+=(isim_toplam(liste[i])*(i+1))
Add Comment
Please, Sign In to add comment