re: Write a simple but impactful script VIEW POST

FULL DISCUSSION
 

Here's my python approach:

from random import sample
with open('leaked_pins.txt', 'w') as f:
    [f.write('%04d\n'%i) for i in sample(range(0, 10000), k=10000)]
 

That is awesome. Didn't know you could use an f.write() inside a list comprehension :D Real nice.

code of conduct - report abuse