Home > Software design >  ValueError: invalid literal for int() with base 10: 'C' , Where is the conversion from str
ValueError: invalid literal for int() with base 10: 'C' , Where is the conversion from str

Time:09-23

I have reviewed similar enter image description here

CodePudding user response:

The problem is that you have 3 if blocks in a row, and you are expecting them to behave like elifs.

When ops[i] is 'C', it enters the first if block, and then, because 'C' != ' ', it enters the else block at the end.

  • Related