I need to write a program that first gets a list of integers from input. That list is followed by two more integers representing lower and upper bounds of a range. Then output all integers from the list that are within that range (inclusive of the bounds).
For example, if the input is:
27 200 49 71
0 60
the output should be:
27 49
This is what I have so far:
input_numbers = input().split(' ')
input_range = input().split(' ')
for number in input_numbers:
if input_range[0] <= number <= input_range[1]:
print('{}'.format(number), end = ' ')
I'm not sure what I'm doing wrong.