+ 1
If I type 7 >= 3, then also output is True. What is the logic here?
Output of 7 > 3 is True which is understandable but why it should be True for 7 >= 3 as well?
4 Antworten
+ 7
Because >= check if > OR = is true, in your both case 7 is still > than 3 so it's a match.
0
>= will check if the first number is more than or equal the second number
If x>3 --> return True if x is 4,5,6,...
If x>=3 --> return True if x is 3,4,5,....
So 7>=3 will return True
0
Thanks Geoffrey. I understood, even if one condition is True, output will be True.
0
It is more than 3
Like:
if 7 == 3:
return True
elif 7 > 3:
return True
else:
return False