Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I'm finished with my program and I need help explainng my program by using #comments. I need help commenting on every section explaning what its
I'm finished with my program and I need help explainng my program by using #comments. I need help commenting on every section explaning what its doing. #Program designed to process gibberish syllables and a word to trabslate, then add the syllables where appropriate. play_again = "Y" while play_again in 'Yy': gibberish = input("Enter the first Gibberish syllable (add * for vowel substitute): ") gibberish2 = input("Enter the second Gibberish syllable (* for vowel substitute): ") word = input("Please enter a word you want to translate: ") vowels = "aeiouAEIOU" vowel_one = False translated = "" prev_char = "" for char in word: if char in vowels and not vowel_one and prev_char not in vowels: vowel_one = True if "*" in gibberish: translated += gibberish.replace('*', char) + char else: translated += gibberish + char elif char in vowels and vowel_one and prev_char not in vowels: if "*" in gibberish2: translated += gibberish2.replace('*', char) + char else: translated += gibberish2 + char else: translated += char prev_char = char print("Your final word: %s" % translated) play_again = input("Play again? (y/n) ") while play_again not in 'YyNn': play_again = input("Please enter y to continue or n to quit: ") print("Thanks for playing!")
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started