Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2 0 . Add a Test Case Look at the test script test.py . You can see that there is space for an additional test
Add a Test Case Look at the test script test.py You can see that there is space for an additional test case in the test procedure testavg. We want you to test the function on range To do this: Create a tuple for range by calling the function and converting it to a tuple. Pass this tuple to avg using tuple expansion. Once you have done this, run the test script again to make sure you pass the new test. def testavg: Test procedure for function avg printTesting avg result func.avg introcs.assertfloatsequalresult result func.avg introcs.assertfloatsequalresult result func.avg introcs.assertfloatsequalresult result func.avg introcs.assertfloatsequalresult result func.avg introcs.assertfloatsequalresult # Test range here if namemain: testavg printModule func passed all tests.
Add a Test Case
Look at the test script test.py You can see that there is space for an additional test case in the test procedure testavg. We want you to test the function on range To do this:
Create a tuple for range by calling the function and converting it to a tuple.
Pass this tuple to avg using tuple expansion.
Once you have done this, run the test script again to make sure you pass the new test.
def testavg:
Test procedure for function avg
printTesting avg
result func.avg
introcs.assertfloatsequalresult
result func.avg
introcs.assertfloatsequalresult
result func.avg
introcs.assertfloatsequalresult
result func.avg
introcs.assertfloatsequalresult
result func.avg
introcs.assertfloatsequalresult
# Test range here
if namemain:
testavg
printModule func passed all tests.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started