# ShowRand from random import randint as randi from random import uniform as randu N = 100000 count=0 for k in range(N): x = randu(0,100) if 10<=x<=30 or 40<=x<=7: count +=1 print float(count)/float(N) count=0 for k in range(N): x = randu(0,100) if 10<=x<=50 and 20<=x<=60: count +=1 print float(count)/float(N) count=0 for k in range(N): x = randi(1,20) if x%2==1: count +=1 print float(count)/float(N) count=0 for k in range(N): x = randi(1,20) if 13<=x<15: count +=1 print float(count)/float(N)