Home > Mobile >  Why won't Python math work with a variable?
Why won't Python math work with a variable?

Time:09-26

I'm trying to do something like this:

UseCounter = 1

UseCounter   1

I think that UseCounter should be 2.

But if i print it, it's still 1.

CodePudding user response:

You haven't added 1 to UseCounter and it still has the value 1.If you want to add 1 to it you must write it like:

UseCounter = 1    
UseCounter  = 1
print(UseCounter)

CodePudding user response:

You need to add equals on it.

UseCounter  = 1
  • Related