I'm new to this area and recently, for a college job I could not turn that line of code into a tuple. function code:
def encontra_impares(lista):
lis = []
if len(lista) > 0:
numero = lista.pop(0)
if numero % 2 != 0:
lis.append(numero)
lis = lis + encontra_impares(lista)
return lis
function call:
print(encontra_impares([1, 2, 3,5,5,9,7,32,1,6]))