Working on my basic Python Programming and I can't seem to solve this problem. I have solved the ability to terminate the program and display an error message. However, I can not get the program to do my calculations if the inputs are fractional values.
Write program that calculates the miles per gallon achieved on a road trip. Ask the user, and accept input of miles driven on the trip, and the Gallons of gasoline used. Expect the user to input fractional values like 243.5 miles or 22.45 gallons. Calculate and display the miles per gallon achieved on the trip. Before you make any calculations make sure that the input is valid. If input is not valid, print an error message and terminate.
# Ask user to input miles driven on trip
miles = float(input("How many miles were driven: "))
# Ask user to input gallons of gasoline used
gasoline = float(input("How many gallons of gasoline were used: "))
whole_number = int
mpg = miles / gasoline
if miles or gasoline == whole_number:
print("Input is not valid. Please input a fractional value")
else:
print(round(mpg, 2), "mpg used on this road trip")
print("End of program")```