Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed
[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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions