Advertisement
bl00dt3ars

06. Barcode Generator

Apr 25th, 2021
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. from_number = int(input())
  2. to_number = int(input())
  3.  
  4. for i in range(from_number, to_number + 1):
  5.     num_to_str = str(i)
  6.     str_from_number = str(from_number)
  7.     str_to_number = str(to_number)
  8.     if int(num_to_str[0]) % 2 == 1 and int(str_from_number[0]) <= int(num_to_str[0]) <= int(str_to_number[0]):
  9.         if int(num_to_str[1]) % 2 == 1 and int(str_from_number[1]) <= int(num_to_str[1]) <= int(str_to_number[1]):
  10.             if int(num_to_str[2]) % 2 == 1 and int(str_from_number[2]) <= int(num_to_str[2]) <= int(str_to_number[2]):
  11.                 if int(num_to_str[3]) % 2 == 1 and int(str_from_number[3]) <= int(num_to_str[3]) <= int(str_to_number[3]):
  12.                     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