Spocoman

Barcode Generator

Jan 5th, 2022 (edited)
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.88 KB | None | 0 0
  1. start_num = int(input())
  2. final_num = int(input())
  3.  
  4. for a in range(start_num // 1000, final_num // 1000 + 1):
  5.     for b in range(start_num // 100 % 10, final_num // 100 % 10 + 1):
  6.         for c in range(start_num // 10 % 10, final_num // 10 % 10 + 1):
  7.             for d in range(start_num % 10, final_num % 10 + 1):
  8.                 if a % 2 == 1 and b % 2 == 1 and c % 2 == 1 and d % 2 == 1:
  9.                     print(f'{a}{b}{c}{d}', end=' ')
  10.  
  11. ИЛИ:
  12.  
  13. start_num = input()
  14. final_num = input()
  15.  
  16. for a in range(int(start_num[0]), int(final_num[0]) + 1):
  17.     for b in range(int(start_num[1]), int(final_num[1]) + 1):
  18.         for c in range(int(start_num[2]), int(final_num[2]) + 1):
  19.             for d in range(int(start_num[3]), int(final_num[3]) + 1):
  20.                 if a % 2 == 1 and b % 2 == 1 and c % 2 == 1 and d % 2 == 1:
  21.                     print(f'{a}{b}{c}{d}', end= ' ')
  22.  
Add Comment
Please, Sign In to add comment