I'm looking to create a function that takes a list and an integer as the argument and outputs the list in ascending order of very value that is less than the value in the second argument.
Then, if the value of integer (second arg) is lower than every value on the list, the function returns a print statement like, "There's nothing here."
def thisFunction(mylist=[], *myNum):
print(mylist)
print(*myNum)
for x in list(int(mylist[0])):
if x > myNum:
mylist.remove(x)
mylist.sort()
elif x < myNum:
print(f"There are no values less than numbers{myNum}")
thisFunction([12,4,5,6,7,11,56],5)
Right now, I get a TypeError: 'int' object is not iterable. I don't know what I'm doing wrong!