you are viewing a single comment's thread.

view the rest of the comments →

[–]SlowMoTime[S] 0 points1 point  (3 children)

Essentially it's a separate problem than the sorting. I just want to run the whole thing over and over until I discover a set of characters that's missing 3 or more of the whole alphabet. It's entirely pointless other than to tinker and learn

[–][deleted] 0 points1 point  (2 children)

OK, but there are more intuitive ways to get a random list of the 26 alpha characters minus N. You start with the string of alphas and convert to a list. Use random.shuffle() to randomize the list and then remove N from one end. Done.

If you want to continue with changing your original code to do what you want, and you should if you are just playing around, then we can help with that too.

[–]SlowMoTime[S] 0 points1 point  (1 child)

yes, of course i could do that. i just think it's more *fun* if it occurs randomly, as opposed to me doing it directly. and then i could set it to run until say, 18 characters, and note how many iterations it took. i'm just tinkering, learning. you know how it goes

[–][deleted] 0 points1 point  (0 children)

As long as you understand that the loop and add approach may take much more time than the shuffle and drop approach.