Little problem with the "+" operator

Raymond Hettinger othello at javanet.com
Mon Mar 5 15:49:00 CET 2001


Zamurai wrote:

> I want to make the following:
>
> variableOne = 500
> myVariable = variableOne + "cool"
>
> But I get the following error: "unsupported operand types for +"
>
> Does someone know how to solve the problem?

Try:
myVariable = str(variableOne) + "cool"






More information about the Python-list mailing list