0
Что значит? TypeError: unsupported operand type (s) for -: 'str' and 'str'
Пожалуйста объясните...
5 Réponses
+ 1
Please add your code on playground and provide the link. Sounds if you were trying to do something with a string, what's not allowed, like e.g. using operand < or >, but one can only help you, if you provide the code or at least the affected lines.
+ 1
Yay, now I can see it 🙃 I used the following sample input (+ , -, * and / already worked properly):
++
1
1
tugadi
And the compiler said there was a missing cast in line 44:
print("1-son + 2-son = " + str(result1))
Your result1 variable was of type float. If you're about to concatenate variables into messages to print, you need to cast them, if they're of different types.
+ 1
Thank you 😊😊
0
I use PyCharm