Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- start = int(input())
- end = int(input())
- thousands_start = start // 1000
- hundreds_start = start // 100 % 10
- tens_start = start // 10 % 10
- units_start = start % 10
- thousands_end = end // 1000
- hundreds_end = end // 100 % 10
- tens_end = end // 10 % 10
- units_end = end % 10
- for number1 in range(thousands_start, thousands_end + 1):
- for number2 in range(hundreds_start, hundreds_end + 1):
- for number3 in range(tens_start, tens_end + 1):
- for number4 in range(units_start, units_end + 1):
- if number1 % 2 == 1 and number2 % 2 == 1 and number3 % 2 == 1 and number4 % 2 == 1:
- print(f'{number1}{number2}{number3}{number4}', end=' ')
Advertisement
Add Comment
Please, Sign In to add comment