lst = input().split()
lst.pop(0)
w = lst[-1]
lst.pop(-1)
newlst = [int(x) for x in lst if int(x) <= int(w)]
print(newlst)
This works for me. Best of luck.
A rotary dial telephone was a popular type of phone design throughout the 20th century. ... This causes the dial to return to its starting position due to an internal recoil spring, while simultaneously generating a series of electrical pulses that interrupt the flow of current on the telephone's line.