Spocoman

07. Safe Passwords Generator

Jan 1st, 2022 (edited)
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.00 KB | None | 0 0
  1. a = int(input())
  2. b = int(input())
  3. pass_count = int(input())
  4. char_A = 35
  5. char_B = 64
  6. output = ''
  7.  
  8. for j in range(1, a + 1):
  9.     for x in range(1, b + 1):
  10.         if char_A == 56:
  11.             char_A = 35
  12.         if char_B == 97:
  13.             char_B = 64
  14.         output += f'{chr(char_A)}{chr(char_B)}{j}{x}{chr(char_B)}{chr(char_A)}|'
  15.         pass_count -= 1
  16.         char_A += 1
  17.         char_B += 1
  18.         if pass_count == 0:
  19.             break
  20.     if pass_count == 0:
  21.         break
  22.  
  23. print(output)
  24.  
  25.  
  26. ДРУГО РЕШЕНИЕ:
  27.  
  28. a = int(input())
  29. b = int(input())
  30. pass_count = int(input())
  31. char_A = 35
  32. char_B = 64
  33. output = ''
  34.  
  35. for j in range(1, a + 1):
  36.     for x in range(1, b + 1):
  37.         if char_A == 56:
  38.             char_A = 35
  39.         if char_B == 97:
  40.             char_B = 64
  41.         print(f'{chr(char_A)}{chr(char_B)}{j}{x}{chr(char_B)}{chr(char_A)}', end='|')
  42.         pass_count -= 1
  43.         char_A += 1
  44.         char_B += 1
  45.         if pass_count == 0:
  46.             exit(0)
  47.  
Add Comment
Please, Sign In to add comment