Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import *
- from random import *
- import time
- nombrePoint = 0
- nombrePointRetenus = 0
- pi = 0
- while nombrePoint <= 100000000:
- pointX = random()
- pointY = random()
- nombrePoint = nombrePoint + 1
- if sqrt(pointX**2 + pointY**2) <= 1:
- nombrePointRetenus = nombrePointRetenus + 1
- pi = 4*(nombrePointRetenus/nombrePoint)
- print (pi)
- print ("le resulat final est = " + pi)
- time.sleep(100)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement