[Python] Deep Thought

Started by TomToad, May 29, 2020, 01:54:58

Previous topic - Next topic

TomToad

Not sure how old of Python version this will work on.  Works with Python 3.8.3.
Code (python) Select
#Deep Thought
#by TomToad
#may 28, 2020
import random

message = "RINETNELENVIYVEEHUI R DF STG AHE,"

the_answer = 42

random.seed(the_answer)
the_question = ''.join(random.sample(message,k=len(message)))

print(the_question)
------------------------------------------------
8 rabbits equals 1 rabbyte.

Scaremonger


Pleased it didn't take 7 and a half million years to run! :D