Python Forum

Full Version: More than or less than
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,


I am relatively new to python and was wondering if someone could tell me what the python syntax is for 'more than' and 'less than'. I have tried the < and > symbols and am told - invalid syntax.

Thanks Big Grin

https://pasteboard.co/hmKmKVVZk.png

https://pasteboard.co/hmL9f7yyJ.png

Some screen shots of the problem
please, don't post images. copy paste code, traceback, etc. in respective tags.
as to the problem

if pay < 1000:
In both Pythons 2 & 3, the convenient shortcut notation:  

a<x<b
works great. That is, the expression returns TRUE if x is greater than a and less than b.