Apr-28-2020, 01:24 PM
As this is homework I will provide ways without for-loop. This may or may not give an ideas.
>>> d = {'ham': 7, 'spam': 42} >>> sum(d.values()) / len(d.values()) 24.5There is mean() in statistics module, so one can do:
>>> from statistics import mean >>> mean(d.values()) 24.5
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.