desislava_topuzakova

06. Special Numbers

Apr 11th, 2021
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. n = int(input())
  2. # 1111 до 9999
  3. for thousands in range (1, 10):
  4. for hundreds in range(1, 10):
  5. for tens in range(1, 10):
  6. for units in range(1, 10):
  7. check1 = n % units == 0
  8. check2 = n % tens == 0
  9. check3 = n % hundreds == 0
  10. check4 = n % thousands == 0
  11.  
  12. if check1 and check2 and check3 and check4:
  13. print(f"{thousands}{hundreds}{tens}{units}", end=" ")
Advertisement
Add Comment
Please, Sign In to add comment