I have not really analysed your code, but clearly there is a mismatch with types when multiplying "cost[0] * cost[1]", such as multiplying a numeric variable with a string. If you are unsure what happens on that line, you can print cost[0] and cost[1] before the multiplication/error.
TypeError: can't multiply sequence by non-int of type 'str'
TypeError: can't multiply sequence by non-int of type 'str'
|
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
TypeError: unsupported operand type(s) for /: 'str' and 'int' | enderfran2006 | 1 | 2,741 |
Oct-01-2020, 09:41 AM Last Post: buran |
|
TypeError: can't multiply sequence by non-int of type 'complex' | FeverDream | 2 | 12,883 |
Jul-12-2018, 11:08 PM Last Post: DeaD_EyE |
|
TypeError: can't multiply sequence by non-int of type 'str' | rmpadilla73 | 4 | 30,564 |
May-28-2018, 12:21 AM Last Post: py_learner |
|
python!TypeError: can't multiply sequence by non-int of type 'float' | shaywune | 2 | 9,609 |
Sep-24-2016, 04:33 PM Last Post: shaywune |
Users browsing this thread: 1 Guest(s)