Python Forum
More than or less than
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
More than or less than
#1
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
Reply
#2
please, don't post images. copy paste code, traceback, etc. in respective tags.
as to the problem

if pay < 1000:
Reply
#3
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.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020