Last active
October 13, 2015 19:48
-
-
Save saltavenger/4247193 to your computer and use it in GitHub Desktop.
probability
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 sampleQuizzes(): | |
yes = 0.0 | |
for i in range(10000): | |
midterm1 = random.randrange(50,81) | |
midterm2 = random.randrange(60,91) | |
finalExam = random.randrange(55,96) | |
finalGrade = midterm1*0.25 + midterm2*0.25 + finalExam*0.50 | |
if finalGrade >= 70 and finalGrade <= 75: | |
yes += 1.0 | |
return yes/10000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment