Sure. The five lines are just for readability.
Comment on Warning: Your AI-Generated Password Is a Major Security Risk. Here’s What to Use Instead
kayzeekayzee@lemmy.blahaj.zone 22 hours agopassword_length=10 letters = "abcdefghijklmnopqrstuvwxyz0123456789-&@$?!*#%" print((letters+letters+letters.upper()+letters.upper()).shuffle()[0:password_length])
Diplomjodler3@lemmy.world 21 hours ago
kayzeekayzee@lemmy.blahaj.zone 21 hours ago
golfing is fun! I do everything in a single line
Deestan@lemmy.world 16 hours 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)])
Deestan@lemmy.world 16 hours ago
print(‘’.join(__import__(‘random’).sample(etc…for one-lining it :)