Stack Exchange
Stack Overflow
Questions
Tags
Users
About
Stack Overflow
Public
Questions
Tags
Users
About
Why does the expression with multiple "+" signs between numbers, following one-by-one, produces the result and no error in python?
Asked
May 14 '22 at 22:05
Active
May 14 '22 at 22:05
Viewed
18 times
-1
For example:
>>> 5 +++++ 5 10
Can anybody explain what is happening under the hood?
python
syntax
operators
edited
May 14 '22 at 22:05
Simon Bondarenko
asked May 14 '22 at 22:05
Simon Bondarenko
1
1
1
The unary operator `+` on an int has no effect. `+5` is equivalent to `5`. And `5 +++++ 5` is equivalent to `5 + (+(+(+(+5))))`
–
khelwood
May 14 '22 at 22:10
0 Answers
0