The output should be like this:
Please enter the miles you drove: 256
Please enter the gallons of gas you put in the tank:
10.1 You got 25.346534653465348 mpg on that tank of gas.
I did this:
miles = float(input("Please enter the miles you drove: "))
gallons = float(input("Please enter the gallons you put in the tank: \n"))
print("You got", miles/gallons, "mpg on that tank of gas.")
but the output shown is:
Please enter the miles you drove: 256
Please enter the gallons you put in the tank:
10.1
You got 25.346534653465348 mpg on that tank of gas.
I need for the 10.1 and the print to be on the same line
How can I do that?