Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from_number = int(input())
- to_number = int(input())
- for i in range(from_number, to_number + 1):
- num_to_str = str(i)
- str_from_number = str(from_number)
- str_to_number = str(to_number)
- if int(num_to_str[0]) % 2 == 1 and int(str_from_number[0]) <= int(num_to_str[0]) <= int(str_to_number[0]):
- if int(num_to_str[1]) % 2 == 1 and int(str_from_number[1]) <= int(num_to_str[1]) <= int(str_to_number[1]):
- if int(num_to_str[2]) % 2 == 1 and int(str_from_number[2]) <= int(num_to_str[2]) <= int(str_to_number[2]):
- if int(num_to_str[3]) % 2 == 1 and int(str_from_number[3]) <= int(num_to_str[3]) <= int(str_to_number[3]):
- print(f"{num_to_str[0]}{num_to_str[1]}{num_to_str[2]}{num_to_str[3]}", end=" ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement