1
Write a program that reads an 8-digit integer number. The output of your program must be the sum of all digits of the given integer. If the number typed does not have 8 digits, the program must write 'NAO SEI' (without accents and quotation marks).
IMPORTANT: You should solve this problem using repeat structure. Otherwise, the note will be zero.
Exemplo 1:
Entrada:
123
Saída:
NAO SEI
Exemplo 2:
Entrada:
34576890
Saída:
42
Guys I made the following code but my note is still 5 of 10 and I think the problem is in this part of:
if n<=1:
print("NAO SEI")
because the program wants that if the number typed does not have 8 digits, the program should write 'DO NOT KNOW'
n=int(input("valor de n:"))
soma=0
while n>0:
resto=n%10
n=(n-resto)//10
soma=soma+resto
print(soma)
if n<=1:
print("NAO SEI")