PYTHON HELP! 1) Write a program that prompts the user for two integers and then
ID: 2079444 • Letter: P
Question
PYTHON HELP!
1) Write a program that prompts the user for two integers and then prints: a) The sum b) The difference c) The product d) The average e) The distance (absolute value of the difference) f) The maximum (the larger of the two) g) The minimum (the smaller of the two)
2) Write a program that asks the user to input: a) The number of gallons of gas in the tank b) The fuel efficiency in miles per gallon c) The price of gas per gallon Then print: a) The cost per 100 miles b) How far the car can go with the gas in the tank MUST BE IN PYTHON! Thanks You
Explanation / Answer
print("the avergae is", 0.5*(x+y))
if (x >y) :
largest = x
else :
largest = y
print("The largest number between",x,",",y," "is",largest)
if (x >y) :
smallest= x
else :
smallest = y
print("The smallest number between",x,",",y," "is" smallest)
1.b
print ("cost per 100miles is", 100*x*(z/)y)
print("the car can go with the gas in the tank is ", 15/z)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.