print(‘’.join(__import__(‘random’).sample(etc… for one-lining it :)
Comment on Warning: Your AI-Generated Password Is a Major Security Risk. Here’s What to Use Instead
kayzeekayzee@lemmy.blahaj.zone 3 weeks agopassword_length=10 letters = "abcdefghijklmnopqrstuvwxyz0123456789-&@$?!*#%" print((letters+letters+letters.upper()+letters.upper()).shuffle()[0:password_length])
Deestan@lemmy.world 3 weeks ago
Diplomjodler3@lemmy.world 3 weeks ago
Sure. The five lines are just for readability.
kayzeekayzee@lemmy.blahaj.zone 3 weeks ago
golfing is fun! I do everything in a single line
Deestan@lemmy.world 3 weeks ago
Python is really good for golfing. The flexible types are ripe for abuse.
print([“fizzbuzz”[n%3and 4:8-(n%5and 4)]or n for n in range(1,101)])