Question: Write a function called convert _ speed which takes a speed in kilometers per hour ( kph ) as an argument. Your function should convert

Write a function called convert_speed which takes a speed in kilometers per hour (kph) as an argument. Your
function should convert kilometers per hour (kph) to miles per hour (mph) and return mph as a float. For example,
60 km =37.284 mi. Assume one kilometer has 0.6214 miles. Use type annotation in the function header to denote
the appropriate data types.
b) The distance a vehicle travels can be calculated as distance = speed \times time. Write a function
called distance_traveled which takes two positive floating-point numbers, the speed of a vehicle (in kilometers
per hour) and the hours it has traveled as arguments. The function returns the total distance traveled in miles as a
float. For example the distance traveled in 3 hours at 40 kph is 74.568 miles. Your function must call
convert_speed. Use type annotations in the function header to denote the appropriate data types.

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 Programming Questions!