A rather simple question but as a newbie, I can get a little lost.
How would I format my function to take a list as an input for my function, and then use another function to sort the said list? I have a functioning code for what I underneath call func1.
func1 (x, list1)
Doing code to sort list1 when x is added
func2 (list2)
out = []
for i in list2:
func1(mylist[i],out)
Not really sure how to define func2 to make it take a list like ex. func2([4,2,3,1]), use func1, to give [1,2,3,4]. out is in the start an empty list. So performing func2 should first look at list[0], take that into func1(4,out) --> out = [4] Next step, it should take list [1] = 2. func1(2, out) --> [4,2] --> [2,4]. And so on until all elements are reviewed and sorted.
If anyone has a good explanation of how to fix func2 I would appreciate it a lot.