Update fifth.py

This commit is contained in:
Daniel
2022-12-09 12:28:58 +02:00
committed by GitHub
parent c471967fbe
commit 2b55db64b5

View File

@@ -4,8 +4,7 @@ from numpy import sqrt
real = 0
positive = 0
for _ in range(10000):
b = random.uniform(-1, 1)
c = random.uniform(-1, 1)
c, b = random.uniform(-1, 1), random.uniform(-1, 1)
delta = b ** 2 - 4*c
if delta > 0:
real += 1
@@ -16,4 +15,3 @@ for _ in range(10000):
print(real/10000)
print(positive/10000)