Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. listanum = []
  2. num = 1
  3.  
  4.  
  5.  
  6. while num != 0:
  7.         num = int(input("digite a sequencia de números: (termine com zero) "))
  8.         listanum.append(num)   #append adiciona o valor ao fim da variável
  9.  
  10.     #-1 pq o vetor sempre começa no zero, mas a contagem começa em 1.
  11.         tam = len(listanum) -1
  12.  
  13.  
  14. while tam >= 0:
  15.         print(listanum[tam], end=", ")
  16.         tam = tam -1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement