Running python v3.6.5 PyCharm
I have a simple for loop with an if and else statement with it:
for i in range(10):
if i > 3 < 5:
print(i, "first")
else:
print(i, "second")
The output I get is:
0 second
1 second
2 second
3 second
4 first
5 first
6 first
7 first
8 first
9 first
but shouldn't the output be:
0 second
1 second
2 second
3 second
4 first
5 second
6 second
7 second
8 second
9 second
Try it yourself. It doesn't make sense to me. Why is it doing this?
Don't really need to know
I know you might be thinking, why didn't you just say
if i == 4
but this is just a simplified problem in my program.
Thanks in advance
Hugo