#Function - Discount for Buy 5 get 1 Free
def Generate_Discount1():
if (entWindow1.get() != ""):
price = 0.99
free = 1
DiscNo = (int(entWindow1.get())+
int(entWindow2.get())+
int(entWindow3.get())+
int(entWindow4.get())+
int(entWindow5.get())+
int(entWindow6.get())+
int(entWindow7.get())+
int(entWindow8.get())+
int(entWindow9.get()))
total_bought = float (price*DiscNo)
total_free = float (price*free)
return 0.2/(total_bought/total_free)
我无法让我的折扣功能正常工作,它是使用tkinter的python 3.4。折扣功能不能正常工作
此功能应该给予折扣,如果客户购买了5个甜甜圈,他们将获得一个免费。
你是什么意思与“不起作用“?你有错误信息吗?你会得到意想不到的行为?此外,您应该尝试制作[MCVE](http://stackoverflow.com/help/mcve),您发布的代码不能由任何人运行和调试。我们必须猜测'totalT','stvDicountOne'等是如何定义的。 – fhdrsdg
示例代码甚至不是有效的Python(*不完全*)。 - 我确定在'''.get''和''set''周围缺少一些东西。只是不知道什么:) –
应该'标签(...)'是'标签(...)'?另外,“set”和“get”应该是什么意思? –