Last active
July 9, 2022 19:21
-
-
Save zhangzhhz/d1048f46a401bf7d618d26e1c3e7f573 to your computer and use it in GitHub Desktop.
Print all English alphabets randomly but in order on one line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 pos in l: | |
c_list[pos] = letters[pos] | |
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