Cod sursa(job #2278834)

Utilizator Code_SniperNetoiu Mihail Code_Sniper Data 8 noiembrie 2018 16:51:37
Problema Text Scor 80
Compilator py Status done
Runda Arhiva de probleme Marime 0.3 kb
with open("text.in") as f:
    text = f.read()

import re
text = re.split(r'[\W]\s*', text)
cuv = len(text)
l = 0
for i in text:
    if i == '':
        cuv -= 1
    l += len(i)

with open("text.out", 'w') as g:
    if cuv:
        g.write(str(l // cuv))
    else:
        g.write(str(0))