Question: a ) def convert _ speed ( kph: float ) - > float: kph _ to _ mph = 0 . 6 2 1 4

a) def convert_speed(kph: float)-> float:
kph_to_mph =0.6214
mph= kph_to_mph * kph
return float(mph)
print(covert_speed(60))
b) def distance_traveled(speed_in_kph:float, hours_traveled: float)-> float:
speed_in_mph = convert_speed(speed_in_kph)
total_traveled= speed_in_mph * hours_traveled
returb float(total_traveled)
print(distance_traveled(40.0,3.0))
c) trace the global doacr and call stack when the following code fragment is executed using your implementations from a) and b)
#--- Your code for convert_speed and distance_traveled here
my_speed =100
def main ():
my_speed =86.5
my_time =3
my_distance = distance_traveled(my_speed, my_time)
print("Traveled distance is: ", my_distance, "miles")
if __name__=="__main__":
main()
Global Space : ?
Call Stack : ?

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!