BbJLeB

09. Password Generator

Jun 4th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. # 09. Password Generator
  2.  
  3. def solve(n, letter):
  4.     letter = letter + 96                # in order to take the value of the final alphabetical letter
  5.  
  6.     for symbol_1 in range(1, n):
  7.         for symbol_2 in range(1, n):
  8.             for symbol_3 in range(ord("a"), letter + 1):
  9.                 for symbol_4 in range(ord("a"), letter + 1):
  10.                     for symbol_5 in range(1, n + 1):
  11.                         if symbol_5 > symbol_1 and symbol_5 > symbol_2:
  12.                             print(f'{symbol_1}{symbol_2}{chr(symbol_3)}{chr(symbol_4)}{symbol_5}', end=" ")
  13.  
  14.  
  15. def main():
  16.     n = int(input())
  17.     letter = int(input())
  18.     solve(n, letter)
  19.  
  20.  
  21. if __name__ == '__main__':
  22.     main()
Add Comment
Please, Sign In to add comment