Cod sursa(job #2389276)
Utilizator | Data | 26 martie 2019 22:17:37 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | py | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#!/usr/bin/env python
import re
import sys
def main():
with open("text.in", "r") as file_in:
words = re.findall(r"[a-zA-Z]+", file_in.read())
with open("text.out", "w") as file_out:
try:
average = len(''.join(words)) // len(words)
file_out.write("{}\n".format(average))
except Exception as e:
sys.exit(0)
return 0
if __name__ == "__main__":
main()