-1
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, '''

It keeps returning the error:

TypeError: can't multiply sequence by non-int of type 'str'

ΦXocę 웃 Пepeúpa ツ
  • 47,427
  • 17
  • 69
  • 97
GAVDADDY
  • 21
  • 3
  • 3
    Possible duplicate of [Why do I get TypeError: can't multiply sequence by non-int of type 'float'?](https://stackoverflow.com/questions/485789/why-do-i-get-typeerror-cant-multiply-sequence-by-non-int-of-type-float) – Bill the Lizard Aug 11 '17 at 13:46

1 Answers1

0

This line is just assigning a string back

if (Pat.isdigit()):
    Pat = Pat

I assume you meant

if (Pat.isdigit()):
    Pat = int(Pat)
Cory Kramer
  • 114,268
  • 16
  • 167
  • 218