Will.prefix and postfix version of addition and subtraction work in python same as it works in c/c++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Will.prefix and postfix version of addition and subtraction work in python same as it works in c/c++

Tried printing the value (x++) it gave an error , tried another way by x=x++ , still an error

19th Aug 2019, 3:07 AM
Aayush Srivastava
Aayush Srivastava - avatar
1 Answer
0
It's not possible and I doubt it will ever be introduced. The closest thing Phython has is "x+=1", but most of the times it's not a direct replacement for "x++/++x".
19th Aug 2019, 3:20 AM
Diego
Diego - avatar