why doesn't making line 4 " if i == 2 or 3:" cause the output to be 1 skipping 2 skipping 2 4 ... ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

why doesn't making line 4 " if i == 2 or 3:" cause the output to be 1 skipping 2 skipping 2 4 ... ?

17th Aug 2016, 2:11 AM
Coleman Alexander
Coleman Alexander - avatar
3 Answers
+ 2
it should be( i==2 or i==3); insted of (i==2 or 3) coz 3 is not getting stored in i
18th Aug 2016, 9:02 AM
Akshat Tekriwal
Akshat Tekriwal - avatar
0
in this case, or takes last precedence and or is a boolean operator
17th Aug 2016, 1:10 PM
Peter Bubolz
Peter Bubolz - avatar
0
I tried parentheses around (2 or 3) but no dice. what would work?
17th Aug 2016, 2:07 PM
Coleman Alexander
Coleman Alexander - avatar