0

Can we use increment and decrement operater in python as we use in java?

A=3 A++ Then A=4, like can we write in python also instead of A+=1

12th May 2020, 5:42 PM
Aksha Shahnwaz
Aksha Shahnwaz - avatar
3 Respostas
+ 4
Not quite. In Python a+=1 works, but a++ doesn't.
12th May 2020, 5:48 PM
Lisa
Lisa - avatar
+ 1
No. In Python has no ++, - - Operators. Short form of increment form is A+=1 Decrement form is A-=1.
12th May 2020, 5:48 PM
Jayakrishna 🇮🇳
0
Okk
14th May 2020, 2:29 PM
Aksha Shahnwaz
Aksha Shahnwaz - avatar