Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- max_x = int(input())
- max_y = int(input())
- max_pass = int(input())
- min_a_ascii = 35
- max_a_ascii = 55
- min_b_ascii = 64
- max_b_ascii = 96
- passwords = []
- a_ascii = min_a_ascii
- b_ascii = min_b_ascii
- password_count = 0
- is_finished = False
- for x in range(1, max_x + 1):
- for y in range(1, max_y + 1):
- a = chr(a_ascii)
- b = chr(b_ascii)
- password = f"{a}{b}{x}{y}{b}{a}"
- # Check if password has been generated before
- if password in passwords:
- is_finished = True
- break # leave for y
- passwords.append(passwords)
- print(f"{password}|", end='')
- password_count += 1
- if password_count == max_pass:
- is_finished = True
- break # leave for y
- a_ascii += 1
- if a_ascii > max_a_ascii:
- a_ascii = min_a_ascii
- b_ascii += 1
- if b_ascii > max_b_ascii:
- b_ascii = min_b_ascii
- if is_finished: # leave also for x
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement