Please help This is for my intro to coding Python class We d
Please help!! This is for my intro to coding: Python class. We did an example similar in class. This is introducing raw_imput, float, print, etc. If you could provide the answers to both parts in Python language that would be great! This is chapter 2 stuff.
Overview For this assignment, your job is to write a program similar to the one we went over in class to calculate how fast you must drive in order to save a certain amount of time when traveling some distance. Your program will compute and display the time saved when traveling a distance when two different speeds are driven. 1. For the first version of the program, the user should be prompted for: The distance to be traveled The lower of the two speeds The higher of the two speeds Each of these values will be stored in a variable. After the user has entered these values, the program should display output similar to the following: For a distance of 100.0 miles you will save 1 minutes by driving 70.0 MPH instead of 60.0 MPH You may assume that the user correctly enters the speeds. 2. For this version of the program, you should allow the user to enter the speeds in either order. Your program will then have to figure out which of the two speeds is the lower speed, and which is the higher speed. You can use the built-in Python functions min and max to help you do this. These functions work like this (Ive shown them being used in an interactive Python session) print max (10, 20) 20 print min (10, 20) 10 You\'ll want to create two new variables to hold the slower and faster speeds, assigning the result of using the min and max functions to these two variables instead of printing them like I\'ve shown.Solution
The solution of the first problem is as follows:
 
 distance = float(raw_input(\"The distance to be travelled: \")) #input for distance
 lowestSpeed = float(raw_input(\"The lower of the two speeds: \")) #input for lowerspeed
 higerSpeed = float(raw_input(\"The higher of the two speeds: \")) #input for higherspeed
 difference =0
 difference = float(distance*60/lowestSpeed) - float(distance*60/higerSpeed) #storing the difference of highest and lowest time
 print (\"For a distance of \" + str(distance) + \" miles, you will save \" + str(difference) + \" minutes by driving \" + str(higerSpeed) + \" MPH instead of \" + str(lowestSpeed) + \" MPH.\")
 
 The solution to the second problem is as follows:
 
 highestSpeed = 0 #variable to store highest speed value
 tmp = float(raw_input(\"Enter Speed 1: \"))
 lowestSpeed = tmp #variable to store lowest speed value
 tmp = float(raw_input(\"Enter Speed 2: \"))
 if (tmp > highestSpeed and tmp > lowestSpeed and lowestSpeed>0):
    highestSpeed = tmp
    print (\"Highest Speed value is \" + str(highestSpeed) + \" and lowest speed value is \" + str(lowestSpeed))
 elif (tmp > highestSpeed and tmp < lowestSpeed and lowestSpeed>0   ):
    highestSpeed = lowestSpeed
    lowestSpeed = tmp
    print (\"Highest Speed value is \" + str(highestSpeed) + \" and lowest speed value is \" + str(lowestSpeed))
 else:
    print \"Highest and Lowest speed values are same.\"
   
   

