Question: Create a Python file named logic _ errors.py and copy the following code. Each line that contains an error, add a hash ( # )

Create a Python file named logic_errors.py and copy the following code.
Each line that contains an error, add a hash (#) at the beginning of each line that contains an error to mark it as a comment and add another comment above it
explaining what the error is, and then another line below that with the corrected code if possible as you did in Ex.1
Note: copy the code as written first. The code will run without any changes to it.
In this example, do not change anything below line 38!
This is an embedded test. This file could be imported into another file for use, after it is fixed. If it is run by itself, it will only test the functions, but if imported into
another program, the functions could be called independently and the tests would not run separately. This is a good way to testing that your functions are working
when they are being used in other programs.
1 #!/usr/bin/env python3
# Palomar College CSIT-175
4 # Your Name Here
5 # find the errors in the sample code.
# constants supplied in project specification.
8 MI_PER_KM =0.62 # Do not change.
9 LBS__PER_KG =2.205 # Do not change.
# convert miles to kilometers
def mi_to_km(miles):
km= miles / MI_PER_KM
return miles
# convert kilometers to miles
def km_to_mi(km):
miles = km / MI_PER_KM
return miles
# convert kilograms to pounds
def kg_to_lbs (kg :
lbs=kg** LBS_PER_KG
return LBS_PER_KG
# convert pounds to kilograms
def lbs_to_kg(lbs):
kg= lbs ** LBS_PER_KG
return lbs
 Create a Python file named logic_errors.py and copy the following code.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!