+ 5

Could anyone help me out with the output of this?!!

x=2 y=4 print(++x+++y) lt's output is 6. Could you explain how?

21st Sep 2017, 5:53 PM
P Poornima
P Poornima - avatar
2 Réponses
+ 11
Python doesn't have post/pre increments. ++x is really just read as +(+x), where + is the identity operator. So, it doesn't really do anything.
21st Sep 2017, 6:02 PM
Rrestoring faith
Rrestoring faith - avatar
+ 1
thank you so much for ur help 😄
21st Sep 2017, 6:10 PM
P Poornima
P Poornima - avatar