fork(2) download
  1. import random
  2.  
  3. a = [0] * 11
  4.  
  5. v = 5
  6.  
  7. for i in range(10000):
  8. v += random.randint(0, 4) - 2
  9. if v < 0:
  10. v = 0
  11. elif 10 < v:
  12. v = 10
  13. a[v] += 1
  14.  
  15. for i in range(11):
  16. print str(a[i])
Success #stdin #stdout 0.05s 10632KB
stdin
Standard input is empty
stdout
1312
800
956
829
842
809
858
823
854
719
1198