Advertisement
bl00dt3ars

03. Special Numbers

May 26th, 2021
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. n = int(input())
  2.  
  3. for num in range(1, n +1):
  4.     is_true = False
  5.     sum_of_num = sum([int(el) for el in str(num)])
  6.     if sum_of_num == 5 or sum_of_num == 7 or sum_of_num == 11:
  7.         is_true = True
  8.        
  9.     print(f"{num} -> {is_true}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement