SHARE
TWEET

Untitled

a guest Oct 14th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. listanum = []
  2. num = 1
  3.  
  4.  
  5. def calculo():
  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. def inversao():
  14.     while tam >= 0:
  15.         print(listanum[tam], end=", ")
  16.         tam = tam -1
  17.  
  18.  
  19.    
  20. calculo()
  21. inversao()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top