Feb-19-2021, 04:15 AM
Not only can you do >= but also <=, !=, is, and is not.
https://docs.python.org/3/library/stdtyp...comparison
You can also combine two comparisons:
https://docs.python.org/3/library/stdtyp...comparison
You can also combine two comparisons:
if 3 <= x < 7:Which is the same as:
if x >= 3 and x < 7:But looking at your original question I don't think you want ">=". You want separate actions for g < h, g > h and g == h. You already do this with a and b. You have one action if a < b, a different action if a == b, and a third action if a > b. What I think you want for g and h is:
if g > h: print('True'): elif g < h: print('False') else: print('Neutral')