Hello everyone, I was trying to do the optional homework but it seems like I cannot get the result I want.
Basically I would like to get my list to delete the first element of itself if it doesn't fit my request (basically, an else statement), and return it without that element.
I developed a function for it, but it seems like it works only once and I can't find a way to let my program repeat this function until the list doesn't have any elements in. I tried using len to get the number of elements in the list too.
Can someone help me understand what I'm doing wrong?
Basically I would like to get my list to delete the first element of itself if it doesn't fit my request (basically, an else statement), and return it without that element.
I developed a function for it, but it seems like it works only once and I can't find a way to let my program repeat this function until the list doesn't have any elements in. I tried using len to get the number of elements in the list too.
Can someone help me understand what I'm doing wrong?