Ooops
October 24, 2021, 22:04:24

Author Topic: [Python] Deep Thought  (Read 778 times)

Offline TomToad

  • Hero Member
  • *****
  • Posts: 556
[Python] Deep Thought
« on: May 29, 2020, 01:54:58 »
Not sure how old of Python version this will work on.  Works with Python 3.8.3.
Code:  (Unknown Language)
  1. #Deep Thought
  2. #by TomToad
  3. #may 28, 2020
  4. import random
  5.  
  6. message = "RINETNELENVIYVEEHUI R DF STG AHE,"
  7.  
  8. the_answer = 42
  9.  
  10. random.seed(the_answer)
  11. the_question = ''.join(random.sample(message,k=len(message)))
  12.  
  13. print(the_question)
  14.  
------------------------------------------------
8 rabbits equals 1 rabbyte.

Offline Scaremonger

  • Full Member
  • ***
  • Posts: 233
    • ITSpeedway - Ramblings of a geek!
Re: [Python] Deep Thought
« Reply #1 on: July 26, 2020, 13:43:43 »

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

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal