Increment and decrement operator in python by R4R Team

In other programming language like C,C++, JAVA, we have a increment(++) and decrement(--) operator which increase and decrease the value respectively.

example -

a=3
a++
a will become 4
a--
a--
a will become 2

-But in python this type of operation is not valid


program -

a=3
a++
print(a)
a--
a--
print(a)


output-

a++
^
SyntaxError: invalid syntax


- In Python, this operator is not supported that's why it will give the error like invalid syntax.

Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!