Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • FYI, string.lowercase is rarely more than ASCII however you set the locale in my experience. I'm just noting that there is no true variable for "current alphabet". Commented Dec 24, 2009 at 10:39
  • Neither of these code samples implies uniqueness. Here is a test: pastie.org/8619409 Commented Jan 10, 2014 at 4:12
  • @Altaisoft: You're misunderstanding how sample works. It only draws any given character once, but it's not drawing in order. So abc and cba would be different outputs. Your test is only valid (would have expected huge numbers of overlaps) if you assume sample returns them in the same order they appeared in the original string, but since they can appear in any order, there are (26+7)! / 7! options; overlaps won't be common. Commented Oct 18, 2016 at 11:27