from collections import Counter

BEREICHE = [
    ('frostig', 0),
    ('kalt',   10),
    ('mild',   20),
    ('warm',   30),
    ('heiß',    0)  # Zahl hier egal
]

def temperatur(t):
    for adjektiv, grenze in BEREICHE[:-1]:
        if t < grenze:
            return adjektiv
    return BEREICHE[-1][0]

def mittel(temps):
    N = len(temps)
    return sum(temps) / N

def report(temps):
    print('Die niedrigste Temperatur war {:.1f} °C.'.format(min(temps)))
    print('Die höchste Temperatur war {:.1f} °C.'.format(max(temps)))
    print('Die Durchschnittstemperatur war {:.1f} °C.'.format(mittel(temps)))
    print('Es gibt Temperaturangaben von {} Tagen.'.format(len(temps)))

    bereiche = Counter(temperatur(t) for t in temps)
    for b, _ in BEREICHE:
        print('An {} Tagen war es {}.'.format(bereiche[b], b))

if __name__ == '__main__':
    import sys
    datei = sys.argv[1]
    with open(datei) as f:
        t = [float(line) for line in f]
    report(t)
