+ 2

Hi, Why the result is 11-11=0,but not 11-1=0?.how it is appeared 11 from the code below ?

https://code.sololearn.com/wXH8MGRrc3UW/?ref=app

14th Sep 2019, 2:10 PM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar
6 Answers
+ 3
print 1 prints 1, then returns one, that’s why there are 2 1’s
14th Sep 2019, 2:26 PM
Aaron.S.F
Aaron.S.F - avatar
+ 3
thanks
14th Sep 2019, 2:28 PM
Aaron.S.F
Aaron.S.F - avatar
+ 2
Thank You?
14th Sep 2019, 2:17 PM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar
+ 2
When you write echo print and then some number, it will always add the number 1 at the end, that is why echo print 1 is 11 and echo print 13 is 131.
14th Sep 2019, 2:35 PM
KfirWe
KfirWe - avatar
+ 1
print 1 prints 1, then returns one, that's why there are 2 1's.
14th Sep 2019, 2:12 PM
Airree
Airree - avatar
+ 1
good for you
14th Sep 2019, 2:27 PM
Airree
Airree - avatar