Skip to content

Instantly share code, notes, and snippets.

@andresmachado
Last active December 2, 2016 02:16
Show Gist options
  • Save andresmachado/8e3ee200c45f3fcd3a5d20f18799f803 to your computer and use it in GitHub Desktop.
Save andresmachado/8e3ee200c45f3fcd3a5d20f18799f803 to your computer and use it in GitHub Desktop.
num = input("Digite um número inteiro: ")
total = 0
i = 0
while i < len(num):
total += int(num[i])
i += 1
print(total)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment