Created
March 20, 2025 21:02
-
-
Save dalepotter/1064034cfcbb153928171b3a3339778d to your computer and use it in GitHub Desktop.
Output enumerated value of an input string. Useful when asked to enter specific characters of a password.
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
# Output enumerated value of an input string | |
# | |
# Example usage: | |
# $ python code_enumerator.py | |
# Enter code to enumerate: 5LMJZJCBCTWU | |
# 1 = 5 | |
# 2 = L | |
# 3 = M | |
# 4 = J | |
# 5 = Z | |
# 6 = J | |
# 7 = C | |
# 8 = B | |
# 9 = C | |
# 10 = T | |
# 11 = W | |
# 12 = U | |
code = input("Enter code to enumerate: ").strip() | |
for idx, char in enumerate(code, start=1): | |
print(f"{idx} = {char}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment