Sep-10-2023, 08:53 AM
Python interactive interpreter is your best friend.
>>> a = [] >>> len(a) 0 >>> # source of ZeroDivsionError >>> data = input('Please enter integers separated by comma: ').split(',') Please enter integers separated by comma: 1,2,3 >>> data ['1', '2', '3'] >>> sum(int(i) for i in data)/len(data) 2.0 >>> # returns float >>> import statistics. >>> # built-in module >>> statistics.mean(int(i) for i in data) 2 >>> # returns intI don't recommend to use capitalized built-ins as names.
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.