Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Open addition.py and look at the definition of add: def add ( a , b ) : Return the sum of a and b
Open addition.py and look at the definition of add:
def adda b:
"Return the sum of a and b
YOUR CODE HERE
return
The tests called this with a and b set to different values, but the code always returned zero. Modify this definition to read:
def adda b:
"Return the sum of a and b
print "Passed as and bs returning absabab
return ab
Now rerun the autograder omitting the results for questions and :
csta@nova ~tutorial$ python autograder.py q q
Starting on at ::
Question q
Passed a and b returning ab
PASS: testcasesqadditiontest
addab returns the sum of a and b
Passed a and b returning ab
PASS: testcasesqadditiontest
addab returns the sum of a and b
Passed a and b returning ab
PASS: testcasesqadditiontest
addab returns the sum of a and b
### Question q: ###
Finished at ::
Provisional grades
Question q:
Question q:
Question q:
Total:
You now pass all tests, getting full marks for question Notice the new lines "Passed a which appear before PASS: These are produced by the print statement in add. You can use print statements like that to output information useful for debugging. You can also run the autograder with the option mute to temporarily hide such lines, as follows:
csta@nova ~tutorial$ python autograder.py q qmute
Starting on at ::
Question q
PASS: testcasesqadditiontest
addab returns the sum of a and b
PASS: testcasesqadditiontest
addab returns the sum of a and b
PASS: testcasesqadditiontest
addab returns the sum of a and b
### Question q: ###
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