这个程序一直在崩溃,我不知道为什么?

时间:2017-08-11 13:42:03

标签: python

g = raw_input("Any other items enter the price: $")
if (g.isalpha()):
    g = 0.0
if (g.isdigit()):
    g = g
else:
    g = 0.0

Pat=(raw_input('And how many of this item:'))
if (Pat.isalpha()):
    Pat = 0.0
if (Pat.isdigit()):
    Pat = Pat
else:
    Pat = 0.0

g_ = (Pat * g)
Total = (a_ + b_ + c_ + d_ + e_ + f_ + g_)
print'Total: $',Total, '''

它不断返回错误:

  

TypeError:不能将序列乘以类型' str'

的非int

0 个答案:

没有答案