Sichanov

barcode

Jul 17th, 2021
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. start = int(input())
  2. end = int(input())
  3. thousands_start = start // 1000
  4. hundreds_start = start // 100 % 10
  5. tens_start = start // 10 % 10
  6. units_start = start % 10
  7. thousands_end = end // 1000
  8. hundreds_end = end // 100 % 10
  9. tens_end = end // 10 % 10
  10. units_end = end % 10
  11. for number1 in range(thousands_start, thousands_end + 1):
  12.     for number2 in range(hundreds_start, hundreds_end + 1):
  13.         for number3 in range(tens_start, tens_end + 1):
  14.             for number4 in range(units_start, units_end + 1):
  15.                 if number1 % 2 == 1 and number2 % 2 == 1 and number3 % 2 == 1 and number4 % 2 == 1:
  16.                     print(f'{number1}{number2}{number3}{number4}', end=' ')
Advertisement
Add Comment
Please, Sign In to add comment