Python Chapter Exam Programs
Python Chapter Exam Programs
M=input("How many liters would you like to convert to Gallons, Quarts, Pints, and
Cups?")
L=M/3.79
G=L%1
a = (L-G)
Q=a%0.25
b = (G-Q)
P=b%0.125
c = (Q-P)
C=c%0.0625
d = (P-C)
O=d%0.0078125
e = (C-O)
print a
print b
print c
print d
print e
#G=M/3.79
#Q=G/4
#P=Q/2
#C=P/2
#O=C/8
#1P=1.39D
#1P=1.27E
#1E=1.10D
#1E=0.79P
#1D=0.91E
#1D=0.72P