So, I'm working on a program which converts input text into Discords regional_indicator emoticons but the issue is that if a word is entered such as "cab" the output will return as "abc". Is there any way of changing the program so that when words are entered, they aren't sorted into alphabetical order. (I've only programmed the first 3 letters for testing purposes. Coded in Python IDLE 3.5)
import sys
sentence = input("Enter a sentence:")
sentenceLower = sentence.lower()
sentenceList = list(sentenceLower)
sentenceListLength = len(sentenceList)
while sentenceListLength > 0:
if "a" in sentence:
sys.stdout.write(":regional_indicator_a:")
sentenceListLength = sentenceListLength - 1
if "b" in sentence:
sys.stdout.write(":regional_indicator_b:")
sentenceListLength = sentenceListLength - 1
if "c" in sentence:
sys.stdout.write(":regional_indicator_c:")
sentenceListLength = sentenceListLength - 1
In short, the program receives a sentence, checks if letters appear in that sentence and then it prints out text to be copy and pasted into Discord.