« Mathématiques avec Python et Ruby/Simulation avec Python » : différence entre les versions

Contenu supprimé Contenu ajouté
Ligne 142 :
from math import hypot
from random import random
p=len([n for n in range(1000000) if hypot(random(),random())<1:])
p=0
for n in range(1000000):
if hypot(random(),random())<1:
p+=1
 
print(p/1000000*4)