Skip to content

Instantly share code, notes, and snippets.

@theminer3746
Last active January 29, 2020 15:36
Show Gist options
  • Save theminer3746/1e3e14dfe1e9957a1616b8ad2d047fab to your computer and use it in GitHub Desktop.
Save theminer3746/1e3e14dfe1e9957a1616b8ad2d047fab to your computer and use it in GitHub Desktop.
When you forgot to change your keyboard from Thai to English (or vice versa) and can't be ask to retype your message
str1 = "`1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./~!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:\"ZXCVBNM<>?"
str2 = "_ๅ/-ภถุึคตจขชๆไำพะัีรนยบลฃฟหกดเ้่าสวงผปแอิืทมใฝ%+๑๒๓๔ู฿๕๖๗๘๙๐\"ฎฑธํ๊ณฯญฐ,ฅฤฆฏโฌ็๋ษศซ.()ฉฮฺ์?ฒฬฦ"
in_text = input().strip()
out_text = ''
for char in in_text:
for i in range(0, len(str1)):
if str1[i] == char:
out_text += str2[i]
break
elif str2[i] == char:
out_text += str1[i]
break
print(out_text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment