Skip to content

Instantly share code, notes, and snippets.

@dalepotter
Created March 20, 2025 21:02
Show Gist options
  • Save dalepotter/1064034cfcbb153928171b3a3339778d to your computer and use it in GitHub Desktop.
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.
# 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