Depending on the decimal precision you need in your answer, you can increase or decrease the step size in arange below. This is a pythonic way of solving the problem using list comprehension:
Example:
import numpy as np
nums = np.arange(0, 6, 0.1)
answers = [x for x in nums if x < 9 and x > 4.5 and x < 5.6 and x > 4.8]
print(answers)
Output:
[4.800000000000001, 4.9, 5.0, 5.1000000000000005, 5.2, 5.300000000000001, 5.4, 5.5]
If you only care about integer answers, use an integer step size:
import numpy as np
nums = np.arange(0, 6, 1)
answers = [x for x in nums if x < 9 and x > 4.5 and x < 5.6 and x > 4.8]
print(answers)
Output:
[5]