Skip to content

Instantly share code, notes, and snippets.

@GitHubEmploy
Created June 3, 2022 18:18
Show Gist options
  • Save GitHubEmploy/81acce196e15c2adf1d62f922da301ae to your computer and use it in GitHub Desktop.
Save GitHubEmploy/81acce196e15c2adf1d62f922da301ae to your computer and use it in GitHub Desktop.
import time
import numpy as np
rscores = np.random.randint(1, 100, size=100000010)
s = time.time()
cfailed = 0
sfailed = 0
for score in rscores:
if score < 70:
sfailed += score
cfailed += 1
print(sfailed/cfailed)
print(f'For Loop: {time.time() - s} seconds')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment