Category Archives: C++

C++

++ equivalent in python

How

by Daniel Stutzbach

Python doesn’t support ++, but you can do:

number += 1

 

Why

by Thomas Wouters

Simply put, the ++ and — operators don’t exist in Python because they wouldn’t be operators, they would have to be statements. All namespace modification in Python is a statement, for simplicity and consistency. That’s one of the design decisions. And because integers are immutable, the only way to ‘change’ a variable is by reassigning it.

Fortunately we have wonderful tools for the use-cases of ++ and — in other languages, like enumerate() and itertools.count().

 

Answers on this page are Stack Overflow user contributions licensed under CC BY-SA 3.0

http://stackoverflow.com/questions/2632677/python-integer-incrementing-with

Annotated: Creative Coding with C++

Note: I changed this title to what it should be “Creative Coding with C++” but the original source was (and still is) “Creating Coding with C++”

https://channel9.msdn.com/Events/CPP/C-PP-Con-2014/001-Creating-Coding-with-CPP

cppcon the c++ conference: http://www.cppcon.org

Presentation Slides, PDFs, Source Code and other presenter materials are available at: https://github.com/CppCon/CppCon2014

Cinder site: http://libcinder.org/

Cinder on GitHub: https://github.com/cinder

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

Mentioned in the presentation: