I am creating a script for my python course.
The script receives as input a sequence of integers terminated by zero and returns the numbers in ascending order, removing the repeated ones.
The script worked from the first compilation, but now that I have split it into a function it is giving some error with the 'list' I do not understand:
TypeError: remove_repetits () missing 1 required positional argument: 'list'
Follow my script:
def remove_repetidos (lista):
lista2 = set(lista)
lista = list(lista2)
lista.sort()
return lista
x = 1
lista = []
while x > 0:
x = int(input("Digite um número inteiro: "))
lista.append(x)
del lista[-1]
remove_repetidos()