number_1=18
number_2=20
print(number_1>=20) or (number_2>=20)
Output: False
I was writing some code for conditional testing in python, and I was very confused on why (number_1>=20) or (number_2>=20) had an output of False.
I know that the or statement has to have at least one of its expressions evaluate to True in order to have an output of True. To support this, the variable number_2=20, so 20>=20 should equal True and therefore making the output True. I was puzzled to see that the output was False. I fiddled around with the code for a while until I had this piece of code, almost identical to the previous one, and it worked surprisingly.
print(number_1>=20 or number_2>=20)
I am struggling to find why this code above me works and the previous code does not work.
Thank you so much for the support!