Skip to content

Instantly share code, notes, and snippets.

@christinepuk
Last active July 13, 2023 18:00
Show Gist options
  • Save christinepuk/0a03ea8f43d1bbc5c364ce649cf0d709 to your computer and use it in GitHub Desktop.
Save christinepuk/0a03ea8f43d1bbc5c364ce649cf0d709 to your computer and use it in GitHub Desktop.
python-class
total = 0
while total >= 40:
     s = input('enter a number: ').strip()
     for one_character in s:
         if not one_character.isdigit():
             print(f'\t{one_character} is a not a digit')
             continue
 
         total += int(one_character)
     print(f'total = {total}')
     
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment