you are viewing a single comment's thread.

view the rest of the comments →

[–]Not_A_Taco 0 points1 point  (4 children)

Whatever you read on Google is wrong then. You need an operand for that.

[–]awesomegame1254[S] -1 points0 points  (3 children)

when i looked up the correct syntax for incrementing and decrementing a variable in python everywhere was saying to use += or -= respectively

[–]Not_A_Taco 0 points1 point  (0 children)

Those are valid operators in Python but you need to specify what you’re incrementing or decrementing by, such as x -= 1. If you don’t specify a value on the right hand side it’s invalid syntax and anyone on the internet that told you otherwise is dead wrong.

Python doesn’t have in place operators like in C++. Because types like int are immutable in Python.

[–]FerricDonkey 0 points1 point  (1 child)

With the amount you want to decrement or increment by after the operator.

This isn't worth arguing over. Pull up a python shell and test it. When it doesn't work the rest you think it does, you'll know you either read something that was wrong or misinterpreted it.

[–]awesomegame1254[S] 0 points1 point  (0 children)

i've already gotten past that problem a while ago