fork download
  1. def ave(ns):
  2. total = sum(ns)
  3. size = len(ns)
  4. return total / size
  5.  
  6. s = input()
  7. ns = [
  8. 100 if c == 'o' else 0
  9. for c in s
  10. ]
  11.  
  12. for i in range(len(s)-1):
  13. print(ave(ns[i:]))
  14.  
Success #stdin #stdout 0.09s 14092KB
stdin
ooxxoxx
stdout
42.857142857142854
33.333333333333336
20.0
25.0
33.333333333333336
0.0