Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
Š§ŃŠ¾ Š·Š½Š°ŃŠøŃ? TypeError: unsupported operand type (s) for -: 'str' and 'str'
ŠŠ¾Š¶Š°Š»ŃŠ¹ŃŃŠ° Š¾Š±ŃŃŃŠ½ŠøŃŠµ...
5 Respostas
+ 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