def entrada( lista) :
while True :
ad = ( int ( input ( 'Digite um valor: ' ) ) )
if ad not in lista:
lista.append ( ad)
print ( 'Adicionado com sucesso!' )
else :
print ( 'Valor duplicado. Adição negada.' )
while True :
ask = str ( input ( 'Deseja continuar?[S/N] ' ) ) .strip ( ) .upper ( ) [ 0 ]
if ask == 'S' :
break
elif ask == 'N' :
return
lista = [ ]
entrada( lista)
print ( lista)
#https://pt.stackoverflow.com/q/352398/101
ZGVmIGVudHJhZGEobGlzdGEpOgogICAgd2hpbGUgVHJ1ZToKICAgICAgICBhZCA9IChpbnQoaW5wdXQoJ0RpZ2l0ZSB1bSB2YWxvcjogJykpKQogICAgICAgIGlmIGFkIG5vdCBpbiBsaXN0YToKICAgICAgICAgICAgbGlzdGEuYXBwZW5kKGFkKQogICAgICAgICAgICBwcmludCgnQWRpY2lvbmFkbyBjb20gc3VjZXNzbyEnKQogICAgICAgIGVsc2U6CiAgICAgICAgICAgIHByaW50KCdWYWxvciBkdXBsaWNhZG8uIEFkacOnw6NvIG5lZ2FkYS4nKQogICAgICAgIHdoaWxlIFRydWU6CiAgICAgICAgICAgIGFzayA9IHN0cihpbnB1dCgnRGVzZWphIGNvbnRpbnVhcj9bUy9OXSAnKSkuc3RyaXAoKS51cHBlcigpWzBdCiAgICAgICAgICAgIGlmIGFzayA9PSAnUyc6CiAgICAgICAgICAgICAgICBicmVhawogICAgICAgICAgICBlbGlmIGFzayA9PSAnTic6CiAgICAgICAgICAgICAgICByZXR1cm4KbGlzdGEgPSBbXQplbnRyYWRhKGxpc3RhKQpwcmludChsaXN0YSkKCiNodHRwczovL3B0LnN0YWNrb3ZlcmZsb3cuY29tL3EvMzUyMzk4LzEwMQ==