Reputation: 792
>>> value = "10.3445" # it starts as a string.
>>> value = float(value)
>>> value in range(10,20)
False
How can I determine whether float is in two integers? I am using python 3.8.1
Upvotes: 2
Views: 115
Reputation: 191711
in range(10, 20)
is the same as in [10, 11, 12, ... 19]
You can instead do 10 <= value < 20
Upvotes: 4