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.

Required fields*

5
  • \$\begingroup\$ How did you find that? It also works for me in Python 2.6.6 on linux. \$\endgroup\$ Commented Aug 5, 2011 at 2:42
  • 5
    \$\begingroup\$ Good to hear! I wrote a small bruteforcing tool to determine how you need to seed the random module to get a certain sequence. With a three-character sequence, this doesn't take too long - this script joins together two three-letter sequences to get "PYTHON" :) \$\endgroup\$ Commented Aug 15, 2011 at 13:24
  • \$\begingroup\$ The rest is using list comprehensions and other dirty tricks to get it to fit it in one line. You can find the bruteforcing tool here :) \$\endgroup\$ Commented Aug 15, 2011 at 13:30
  • \$\begingroup\$ And it works on my Python 3.1.2 (adding parentheses after print, of course). \$\endgroup\$ Commented Aug 16, 2011 at 20:18
  • 1
    \$\begingroup\$ Almost there: generateSentence(50613, 73)[66:] gives 'PYTHOCN'. \$\endgroup\$ Commented Aug 16, 2011 at 20:45