Re:Ask HN: How do you guys pick your usernames?
by nonrandomstring on Saturday September 17, 2022 @06:21AM
(#32876344)
> import string import random
I strongly disapprove of this algorithm.
Re:Ask HN: How do you guys pick your usernames?
by wojtekwojtek on Monday September 19, 2022 @02:21AM
(#32894904)
You may use `string.ascii_letters` to use both cases of ascii letters
Instead of extending the array two times, simply go with s = [ s1, s2, ]
or even simpler s1 + s2
And more idiomatic print (IMO):
login = "".join(random.sample(s, 12)) print(f"{login=}")
if __name__ == "__main__": s1 = string.ascii_lowercase s2 = string.ascii_uppercase