Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wonderful reference for comparison! I admittedly haven't had time to pursue the whole table, but wanted to point out that there is indeed an increment and decrement in python:

x += 1

x -= 1



They list those under "compound assignment operators", which makes sense given that += and -= are found in all of these languages. It's also worth noting that compound assignment operators do not form expressions in Python. So "i++" in PHP/Perl/Ruby is very different from "i += 1" in Python.


An increment/decrement operator is unary and doesn't give you the ability to change the value by any more than one.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: