Advertisement
GeorgiLukanov87

special_number100/100

Apr 3rd, 2022
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. number = int(input())
  2. for current_num in range(1111, 9999 + 1):
  3.     number_is_magic = False
  4.     current_num_as_string = str(current_num)
  5.     for current_digit in current_num_as_string:
  6.         if int(current_digit) == 0 or number % int(current_digit) != 0:
  7.             number_is_magic = True
  8.             break
  9.     if not number_is_magic:
  10.         print(current_num, end=" ")
  11.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement