Задание 10.2 «Python для всех»Python

Программы на Python
Anonymous
Задание 10.2 «Python для всех»

Сообщение Anonymous »


name = input("Enter file:") if len(name) < 1: name = "mbox-short.txt" handle = open(name) counts = dict ( ) for line in handle: line = line.rstrip( ) if line.startswith('From'): words = line.split( ) if len(words) < 6: continue time = words[5] hour = time.split(":") hour = hour[:1] for hours in hour: count[hours] = count.get(hours, 0) +1 print(sorted([(v, k) for k, v in counts.items( )])) The system is returning: "hours not defined on line..."


Источник: https://stackoverflow.com/questions/780 ... -everybody

Вернуться в «Python»