Good Night, I'm a beginner in IT and I'm doing a basic python course, I have to implement the following:
Write a program that receives a sequence of integers ending with 0 and prints all values in reverse order. ** Note that 0 (ZERO) should not be part of the sequence.
Example:
Digite um número: 1 Digite um número: 7 Digite um número: 4 Digite um número: 0 4 7 1
I made the following code, but I can not restrict 0.
seq = []
i = 1
while i > 0:
n = int(input("Digite n: "))
seq.append(n)
while n == 0:
for i in seq[i]:
print (i)
i -= 0
Could someone tell me what I did wrong ???