Skip to content

Instantly share code, notes, and snippets.

@Lenochxd
Created April 23, 2024 17:40
Show Gist options
  • Save Lenochxd/1d7214ab12a010e4d897d0d21b6c66b7 to your computer and use it in GitHub Desktop.
Save Lenochxd/1d7214ab12a010e4d897d0d21b6c66b7 to your computer and use it in GitHub Desktop.
convert alphabet to cuneiform or vice versa using python
alphabet = 'abcdefghijklmnopqrstufwxyz'
cuneiform = 'π’‹»π’€π“π’“π’€ΌπŽ£π’‹π’€‚π’•π’‘Ÿπ’žπ’‡πŽ π’–π’†Έπ’‡¬π’Œ’π’‡²π’”Όπ’ˆ¦π’‘šπŽπ’‰Όπ’‰½π’Œ¨π’‘£'
print("a: from alphabet to cuneiform.")
print("c: from cuneiform to normal text")
choice = input("Enter your choice (a/c): ").replace(' ', '')
if choice == 'a' or choice == '':
text = input("Enter text to convert to cuneiform: ")
converted_text = ""
for char in text:
if char in alphabet:
index = alphabet.index(char)
converted_text += cuneiform[index]
else:
converted_text += char
print("Converted text:", converted_text)
elif choice == 'c':
text = input("Enter text to convert from cuneiform: ")
converted_text = ""
for char in text:
if char in cuneiform:
index = cuneiform.index(char)
converted_text += alphabet[index]
else:
converted_text += char
print("Converted text:", converted_text)
else:
print("Invalid choice. Please enter 'a' or 'c'.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment