- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
'; var adpushup = adpushup || {}; adpushup.que = adpushup.que || []; adpushup.que.push(function() { adpushup.triggerAd(ad_id); });
In C, C++, Java etc ++ and -- operators increment and decrement value of a variable by 1. In Python these operators won't work.
In Python variables are just labels to objects in memory. In Python numeric objects are immutable. Hence by a++ (if a=10) we are trying to increment value of 10 object to 11 which is not allowed.
>>> a=10>>> a++SyntaxError: invalid syntax
Instead we have to use += operator
>>> a=a+1>>> a11
- Related Questions & Answers
- How does Overloading Operators work in Python?
- How does Python while loop work?
- How does tuple comparison work in Python?
- How does mkdir -p work in Python?
- How does garbage collection work in Python?
- How does class inheritance work in Python?
- How does issubclass() function work in Python?
- How does isinstance() function work in Python?
- How does Python dictionary keys() Method work?
- How does [d+] regular expression work in Python?
- How does B regular expression work in Python?
- How does * operator work on list in Python?
- How does variable scopes work in Python Modules?
- How does constructor method __init__ work in Python?
- How does jQuery.scrollTop() work?
Previous Page Print PageNext Page
Advertisem*nts
';adpushup.triggerAd(ad_id);});