Question: Need help on parts A, B, and D. C is correct already. Exercise 1 a) Write a function that converts degrees Farenheit into Celsius. To

 Need help on parts A, B, and D. C is correct

Need help on parts A, B, and D. C is correct already.

Exercise 1 a) Write a function that converts degrees Farenheit into Celsius. To convert temperature in degrees Fahrenheit to Celsius, subtract 32 and multiply by 5/9. In [ ] : b) Write a function to convert a distance from miles to kilometers. (Note: 1mi=1.609344km.) In [4]: def miles_to_kilometers(miles): kilometers = miles 1.609344 return kilometers In [ ] : c) Write a new function miles_km_fix, based on miles_km, that also checks the sign of its parameter dist . If dist is negative, the function should return the string 'distance cannot be negative'. Otherwise, the function should behave like miles_km .. In [5]: def miles_km_fix(dist): if dist

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!