Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import random
- kp = 1000000
- kk = 0
- for i in range(1000000):
- if random() ** 2 + random() ** 2 <= 1:
- kk += 1
- print(4 * kk / kp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement