fork download
  1. # your code goes here
  2.  
  3. import random
  4.  
  5. rare4=0
  6. tenjo=0
  7. for i in range(1000000):
  8. lot=random.randrange(100)
  9. if lot==0 or tenjo==99:
  10. rare4+=1
  11. tenjo=0
  12. else:
  13. tenjo+=1
  14.  
  15. print(rare4/1000000.0)
  16.  
Success #stdin #stdout 0.8s 37952KB
stdin
Standard input is empty
stdout
0.015811