Advertisement
Spocoman

12. The song of the wheels

Jan 2nd, 2022
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. number = int(input())
  2. password = 'No!'
  3. output = ''
  4. counter = 0
  5. for a in range(1, 10):
  6.     for b in range(1, 10):
  7.         for c in range(1, 10):
  8.             for d in range(1, 10):
  9.                 if a * b + c * d == number and a < b and c > d:
  10.                     output += f'{a}{b}{c}{d} '
  11.                     counter += 1
  12.                     if counter == 4:
  13.                         password = f'Password: {a}{b}{c}{d}'
  14.    
  15. print(f'{output}\n{password}')
  16.  
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement