Skip to content

Instantly share code, notes, and snippets.

@zhangzhhz
Last active July 9, 2022 19:19
Show Gist options
  • Save zhangzhhz/231d0e329245967ca893e7969c5a41b4 to your computer and use it in GitHub Desktop.
Save zhangzhhz/231d0e329245967ca893e7969c5a41b4 to your computer and use it in GitHub Desktop.
Print all English alphabets in order but at random positions on one line
#!/usr/bin/env python3
from string import ascii_lowercase, ascii_uppercase
from random import shuffle
from time import sleep
for letters in [ascii_lowercase, ascii_uppercase]:
l = list(range(26))
shuffle(l)
c_list = [" "] * 26
for c in letters:
c_list[l.pop()] = c
print(''.join(c_list), end="\r", flush=True)
sleep(0.1)
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment