Question: can't get past this error. what am I doing wrong. [83]: import numpy as np # Your solution def CalculateProb(prob, numDays, scenarios): # creating a
can't get past this error. what am I doing wrong.
![can't get past this error. what am I doing wrong. [83]: import](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/10/670e4c10efb75_224670e4c10d7d3e.jpg)
[83]: import numpy as np # Your solution def CalculateProb(prob, numDays, scenarios): # creating a function to check the probability of you buying the tea collecti buyTeaProb = 0 for _ in range(scenarios): # checking if the mug was purchased before reaching the amount of days until pay cheque mugPurchase = False for day in range(numDays): if mugPurchase(prob): mugPurchase = True if mugPurchase: buyTeaProb += 1 # adds 1 to the buyTeaProb counter probability = buyTeaProb / sceanrios return probability print(calculateProb(0.37, 7, 10)) NameError Traceback (most recent call last) Cell In [83], line 6 3 def CalculateProb(prob, numDays, scenarios): # creating a function to check the probability of you buying the tea collection buyTeaProb = 0 6 for _ in range( scenarios): # checking if the mug was purchased before reaching the amount of days until pay cheque mugPurchase = False 9 for day in range(numDays) : NameError: name 'scenarios' is not defined
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
