I'm having a bit of trouble, I took an input from the user in the main function and then is supposed to go through the uppercase function, the result of that function is supposed to go to the abbreviation function and the result of that is supposed to go to the replace function and then print the final result .
letter_replacements = {
'E': '3',
'O': '0',
'C': '[',
'A': '@',
'K': '|<',
'I': '1',
'S': '$',
'N': '/\/'
}
abberviation_replacements = {
'TOMORROW': 'TMR',
'ABOUT': 'BOUT',
'PLEASE': 'PLZ',
'BEFORE': 'B4'
}
def uppercase(newWord):
new_uppercase=''
for letters in newWord:
if ord(letters) > 96:
new_uppercase += chr(ord(letters)-32)
else:
new_uppercase += letters
print(new_uppercase)
return new_uppercase
def replace_abberviation():
new_abber=new_uppercase.split()
for i in range(len(li)):
if new_abber[i] in abberviation_replacements:
new_abber[i]=abberviation_replacements[new_abber[i]]
print(" ".join(new_abber))
def replace_letter(newString):
old,new = [],[]
char = input("Change: ")
for ch in char:
if letter_replacements.get(ch):
newString = newString.replace(ch, letter_replacements.get(ch))
print(newString)
#this is the definition of your main function
def main():
print("Hello, And Welcome to this Slang Program")
cap_letters = input("Please enter your string here: ")
uppercase(cap_letters)
replace_abberviation()
# write the part of the program that interacts with the user here
replace_letter(uppercase(cap_letters))
# these should be the last two lines of your submission
if __name__ == '__main__':
main()