Answer:
i dont understand what you mean and what you are asking in the qestion
Explanation:
If it stores any type of objects mixed, use Object as storage class. All classes inherit from Object and for primitives use their respective wrapper classes. Or just use one of the bazillion container classes that already exist.
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.