Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- write a script that produces all possible 4-digit numbers (0000...9999),
- then put them into a random order and save the output into a text file.
- """
- def gen_pins():
- """Generates the pins"""
- pins = {str(n).zfill(4) for n in range(0, 10000)}
- return pins
- def save_pins(pins, filename):
- """Saves the pins to a text file"""
- with open(filename, 'w') as file:
- for pin in pins:
- file.write(f'{pin}\n')
- def main():
- """Runs the script"""
- filename = 'leaked_pins.txt'
- pins = gen_pins()
- save_pins(pins, filename)
- print(f'Generated: {filename}')
- if __name__ == '__main__':
- main()
Add Comment
Please, Sign In to add comment