Can anyone explain why given input to equal 6 or 7 it prints 4567 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Can anyone explain why given input to equal 6 or 7 it prints 4567

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

24th Dec 2018, 3:45 AM
Jacob Heath
Jacob Heath - avatar
3 Answers
+ 3
It is possibly because the or statements don't include the SUM variable. So basically you're saying "if SUM is equal to "x+x" or ("x+x") is true". What you need to do is: if SUM == "3+1" or SUM == "2+2" Do this for them all starting at the 4 sum
24th Dec 2018, 4:06 AM
Zeke Williams
Zeke Williams - avatar
+ 5
Of course! Happy coding
24th Dec 2018, 4:17 AM
Zeke Williams
Zeke Williams - avatar
+ 4
Thanks for helping!
24th Dec 2018, 4:14 AM
Jacob Heath
Jacob Heath - avatar