Created
May 28, 2022 15:10
-
-
Save francoisstamant/032f019ad315b2c8cd12a66de59cb5f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def Monte_Carlo(iterations, variables, weights, grade): | |
final_results=[] | |
for n in range(iterations): | |
results=[] | |
for i in range(len(variables)): | |
value = weights[i] * (random.uniform(grade[i][0], grade[i][1])) | |
results.append(value) | |
final_results.append(sum(results)) | |
return final_results |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment