Okay so I've read that in python, the operators '++', '--' etc. are not implemented (like in c++). I also get the reason behind: they are not needed as often, thanks to iteration with range(8), and so on. But then what exactly happens when someone does use them? After testing: c = 0 c = ++c # seemingly nothing changes c = c++ # throws syntax error
1/21/2018 11:19:41 AM
rdhelli3 Answers
New Answeryou cannot use this operators, because they are not implemented when you do c=++c, it is something like c= -c. The second changes the sign of the number. When you use + instead of -, it doesn't change the sign. ++c is the same operation applied twice, so c=++c is the same as c=c
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message