Skip to content

Instantly share code, notes, and snippets.

@ErikBoesen
Created March 26, 2022 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ErikBoesen/cc06aae434da39957375dbf2b4877562 to your computer and use it in GitHub Desktop.
Save ErikBoesen/cc06aae434da39957375dbf2b4877562 to your computer and use it in GitHub Desktop.
import random
with open('answers.js', 'r') as f:
lines = f.readlines()
first = lines.pop(0)
last = lines.pop()
random.shuffle(lines)
lines.insert(0, first)
lines.append(last)
with open('answers.js', 'w') as f:
f.write(''.join(lines))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment