很抱歉,我对这件事太陌生了,这一切让我很困惑。我搜索了这些问题,但似乎找不到答案。我对每件事都很满意,直到它问你买了多少包为止。我想让程序来决定所采用的折扣率。然后我希望程序计算的金额到期;折扣率将被应用和最终金额将由客户支付。这真的让我很沮丧,因为我不知道从哪里开始。我认为最好的方法是用if-elif-else,但很明显我可能错了。如有任何帮助,我们将不胜感激。在print "Bags Discount Calculator"
print "Please follow he on screen instructions"
print "--------------------------------------- "
print "Rate of Discount based on the following:"
print "____________________________________________"
print "Number of Bags: Rate of Discount:"
print "____________________________________________"
print "Less than 25 0%"
print "From 25-49 5%"
print "From 50-99 10%"
print "100 or more 20%"
print "_____________________________________________"
password=raw_input ("Please enter your password:")
if (password=="di8count"):
print ("\n\tPasssword accepted")
numberofbags=raw_input ("Enter number of bags purchasd:")
if (numberofbags<25):
discountRate = .05
else:
print("\n\tIncorrect Password. Please try again.")