Half_ounce = 14.#grams
One_ounce = 28.#grams
A_quarter = 112.#grams
One_pound = 448.#grams
print 'I will tell you about the basic gram scale for banana's'
print# Line space
print "A half an ounce equals to %s" % Half_ounce
print "A half an ounce divided by 2 eqauls"
print Half_ounce / 2,('which is a 7th')
print# line Space
print "Multiply %d by 4 and you get %s grams." % (Half_ounce, One_ounce)
print# line Space
print "One ounce equals to %d grams" % One_ounce
print "Now divide %s by 2 and you get " % One_ounce
print One_ounce / 2
print
print "4 ounces multiplied by %d will give you %s" % (One_ounce, A_quarter)
print "%s divided by 2 will give you" % A_quarter
print A_quarter / 2
print "Which is a half ounce."
print
print"%s equals to a a pound" % One_pound
print "divide %d by 2 and you get."% One_pound
print One_pound / 2
print
print
# interactive script
print ("Now lets interact")
print
print ("Make a choice and i will")
print ("tell how many grams are in each one.")
print ("These are your choices")
print ("Half ounce, One ounce, A quarter, One pound")
run = int(input("Enter your choice:"))
while run:
choice = int(input("Enter your choice:"))
if choice == ("Half ounce"):
print %d Half_ounce
run = False
##############################################
I'm reading learn py the hard way, so you see all of the print is where #
im practicing using %d and %s. And then i want to turn the program #
into an interacive one. I ended the program at run = False to test the #
output. #
##############################################