#597 · Modules and random · Intermediate · 70 XP · about 12 min
Write make_password(length, seed) that builds a password of length characters with these rules:
!@#$%&*.length and seed always give the same password.Use a generator of your own, rng = random.Random(seed), and call its methods, such as rng.choice and rng.shuffle. Calling random.seed(seed) instead would reset the shared generator that the rest of the program uses for its own random numbers.
make_password(12, 7) # returns a password such as 'q7#Rk2!mWb4z' make_password(12, 7) # returns that same password again make_password(4, 1) # four characters, one of each kind
4 <= length <= 100The tests check the rules above for many seeds, never one exact password.
First solves only, ranked by stars and then time.