def probabilty(x): if x >= 0 and x<=1: return x else: return 0