def f(lst):
a = i = 0
n = len(lst)
while i < n:
if lst[i] <= 0:
i += 1
continue
a += lst[i]
i += 1
return a / n
d = dict()
while True:
try:
line = input("EOF to stop> ")
except EOFError:
break
for i in line:
d[i] = d.get(i, 0) + 1
u = d.keys()
for i in sorted(u):
print(i, d[i])
def y(n):
if n < 10:
return str(n)
else:
d = str(n % 10)
return y(n // 10) + d
print(y(174))
ECS 10, Basic Concepts of Computing Winter Quarter 2012 |