go6odn28

Barcod_generator

Oct 14th, 2023
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. start_number = input()
  2. end_number = input()
  3. n_1 = 0
  4. n_2 = 0
  5. n_3 = 0
  6. n_4 = 0
  7. e_1 = 0
  8. e_2 = 0
  9. e_3 = 0
  10. e_4 = 0
  11. for x, number in enumerate(start_number):
  12.     if x == 0:
  13.         n_1 = int(number)
  14.     elif x == 1:
  15.         n_2 = int(number)
  16.     elif x == 2:
  17.         n_3 = int(number)
  18.     else:
  19.         n_4 = int(number)
  20. for y, number_end in enumerate(end_number):
  21.     if y == 0:
  22.         e_1 = int(number_end)
  23.     elif y == 1:
  24.         e_2 = int(number_end)
  25.     elif y == 2:
  26.         e_3 = int(number_end)
  27.     else:
  28.         e_4 = int(number_end)
  29. for a in range(n_1, e_1 + 1):
  30.     for b in range(n_2, e_2 + 1):
  31.         for c in range(n_3, e_3 + 1):
  32.             for d in range(n_4, e_4 + 1):
  33.                 if a % 2 != 0 and b % 2 != 0 and c % 2 != 0 and d % 2 != 0:
  34.                     print(f'{a}{b}{c}{d}', end=' ')
  35.  
Add Comment
Please, Sign In to add comment