Initial commit: Python learning project with examples and exercises
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
#4.6.1
|
||||
from random import*
|
||||
from math import*
|
||||
N1 = 0
|
||||
N = eval((input()))
|
||||
for i in range(N):
|
||||
x = random()
|
||||
y = random()
|
||||
if hypot(x,y)<=1:
|
||||
N1+=1
|
||||
print(N1/N*4)
|
||||
Reference in New Issue
Block a user