Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Try submitting the program for grading ( click Submit mode, then Submit for grading ) . Notice that the first two test cases fail, but

Try submitting the program for grading (click "Submit mode", then "Submit for grading"). Notice that the first two test cases fail, but the third test case passes. The first test case fails because the program outputs the result from the kilo_to_pounds() function, which has an error. The second test case uses a Unit test to test the kilo_to_pounds() function, which fails.
Change the kilo_to_pounds() function to multiply the variable kilos by 2.204, instead of dividing. The return statement should be: return (kilos *2.204). Submit again. Now the test cases should all pass.def kilo_to_pounds(kilos):
# This statement intentionally has an error.
return (kilos /2.204)
# Main part of the program starts here. Do not remove the line below.
if __name__=='__main__':
kilos = float(input())
pounds = kilo_to_pounds(kilos)
print(f'{pounds:.3f} lbs')

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions