List: Pig Latin Project

NOTE: USE SLICING FOR THESE ASSIGNMENTS

Programming Project:
One of the rules for converting English to Pig Latin states: If a word begins with a consonant, move the consonant to the end of the word and add “ay”. Thus “dog” becomes “ogday”, and “crisp” becomes “rispcay”. If the word starts with a vowel, move the vowel to the end of the word and add the vowel followed by “way”. Example: “about” would turn into “boutaway” There are some variations to this last rule but it is ok if you do something else.

Write 2 python programs to convert from English to Pig Latin.
1. The first program, PigLatinWord_YI.py, should prompt the user for one English word. Your program then should display the word in Pig Latin.
2. The second program, PigLatinPhrase_YI.py, should prompt the user for a full sentence in English. Your program then should display the sentence in Pig Latin.

Recall what we learned from hangman.py
https://inventwithpython.com/chapter9.html

def displayBoard(HANGMANPICS, missedLetters, correctLetters, secretWord):
    print(HANGMANPICS[len(missedLetters)])
    print()
 
    print('Missed letters:', end=' ')
    for letter in missedLetters:
        print(letter, end=' ')
    print()
 
    blanks = '_' * len(secretWord)
 
    for i in range(len(secretWord)): # replace blanks with correctly guessed letters
        if secretWord[i] in correctLetters:
            blanks = blanks[:i] + secretWord[i] + blanks[i+1:]
 
    for letter in blanks: # show the secret word with spaces in between each letter
        print(letter, end=' ')
    print()