First, let me note that your initial if statement is flawed and always executes the if and never the else. So I changed it. I believe this is what you’re trying to do:
def main(): word = input('Please enter a word ') if word in "AEIOU": print(word + "hay") else: print(word.upper() + word[2:] + word.lower() + "ay") main()
This uses string slicing, where string[a:b] goes from string[a] up to but not including string[b], and when I leave out b it just goes to the end of the word.
CLICK HERE to find out more related problems solutions.