So I am writing code for an assignment where we are two remove the even and sort the values of two lists, and my code is doing that well except that I am returning “None” as well as the sorted list.
Here is my code:
def remove_even(L1, L2):
L3=[]
for i in range(0,len(L1)):
if L1[i] %2 != 0:
L3.append(L1[i])
for i in range(0,len(L2)):
if L2[i] %2 != 0:
L3.append(L2[i])
L3=list(set(L3))
L3.sort()
print()
It is a tweaked version of the previous problems where we had to keep the even, and it did not return any None hence my confusion.
AlphaOne is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.