Advertisement
EmiMancilha

079 lista sem numeros repetidos e em ordem crescente

Oct 20th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. #lista com valores infinitos = usar whilen
  2. numero = []
  3. while True:
  4.     n = int(input('Digite um valor: '))
  5.     if n not in numero:
  6.         numero.append(n)
  7.     else:
  8.         print('esse numero ja está na lista')
  9.     r = str(input('quer continuar? [S/N] '))
  10.     if r in 'Nn':
  11.         break
  12. numero.sort()
  13. print(f'voce digitou os valores {numero}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement