Is this what you are looking for?
def check(value):
if 0.50 <= value <= 150 and round(value,2)==value:
return True
return False
Based on your comment:
i input 15.22366 it will return true; therefore, I indicated a range; he must accept 15.22
, . . , , 1.40. " ":
>>> f = 1.40
>>> print f
1.4
. Python , . , f, :
>>> from decimal import Decimal
>>> Decimal(f)
Decimal('1.399999999999999911182158029987476766109466552734375')
2 , f ?
, , round(...,2), . - " " . . :
>>> for v in [ 1.40,
... 1.405,
... 1.399999999999999911182158029987476766109466552734375,
... 1.39999999999999991118,
... 1.3999999999999991118]:
... print check(v), v
...
True 1.4
False 1.405
True 1.4
True 1.4
False 1.4
, . , .
, , , , " ". Python decimal .