クラスのプログラムを入力しています。問題は非常に奇妙に表現されていますが、問題のコードを入力しました。数値を float として正しく宣言していますか? 簡単な質問ですが、私は物事を行う他の方法に心を開いています。
print " This program will calculate the unit price (price per oz) of store items,"
print " you will input the weight in lbs and oz, the name and cost."
item_name = (input("Please enter the name of the item. "))
item_lb_price = float(input("Please enter the price per pound of your item "))
item_lbs = float(input("please enter the pounds of your item. "))
item_oz = float(input("plese enter the ounces of your item. "))
unit_price = item_lb_price / 16
total_price = item_lb_price * (item_lbs + item_oz / 16)
print "the total price per oz is", unit_price
print "the total price for", item_name, "is a total of", total_price