from random import * def test_individu(): if random() < 0.04: contamine = True if random() < 0.99: test = True else: test = False else: contamine = False if random() < 0.09: test = True else: test = False return test def test_pop(n): positifs = 0 for i in range(n): positifs = positifs + test_individu() return positifs / n