Hello,  I have included my python code what should I added to my code to get the result in the second photo. Thank you def add_gibberish(word, gib1, gib2): vowels = "AaEeIiOoUu" flag = True last = False i = 0 while (i < len(word)): #traverse whole word if word[i] in vowels: # if character in a word is vowel if last == False: # if last charcater was not vowel if flag == True: #check if first occurence of vowel word = word[0:i] + gib1 + word[i:len(word)] #add gibberish to the word i = i + len(gib1) + 1 flag = False last = True else: word = word[0:i] + gib2 + word[i:len(word)] # if other than first occurence of vowel i = i + len(gib2) + 1 last = True else: i = i + 1 else: # if character is not vowel last = False # set last character was not vowel i = i + 1; return word def start(): gib1 = input("Enter first gibberish syllable: ") gib2 = input("Enter second gibberish syllable: ") word = input("Enter a word to translate: ") new_word = add_gibberish(word, gib1, gib2) print("Gibberish word is: ", end=" ") print(new_word) do_again() def do_again(): print("Do you want to play again: 'y' for yes and 'n' for no ") ans = input() if (ans in "Yy"): start() elif (ans in "Nn"): exit(0) else: print("Enter a valid input") do_again() print("Let's play a game. Give us a word and gibberish syllable. Using that we will translate your word to gibberish") start()

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Hello, 

I have included my python code what should I added to my code to get the result in the second photo.

Thank you

def add_gibberish(word, gib1, gib2):
vowels = "AaEeIiOoUu"
flag = True
last = False
i = 0
while (i < len(word)): #traverse whole word
if word[i] in vowels: # if character in a word is vowel
if last == False: # if last charcater was not vowel
if flag == True: #check if first occurence of vowel
word = word[0:i] + gib1 + word[i:len(word)] #add gibberish to the word
i = i + len(gib1) + 1
flag = False
last = True
else:
word = word[0:i] + gib2 + word[i:len(word)] # if other than first occurence of vowel
i = i + len(gib2) + 1
last = True
else:
i = i + 1
else: # if character is not vowel
last = False # set last character was not vowel
i = i + 1;
return word


def start():
gib1 = input("Enter first gibberish syllable: ")
gib2 = input("Enter second gibberish syllable: ")
word = input("Enter a word to translate: ")
new_word = add_gibberish(word, gib1, gib2)
print("Gibberish word is: ", end=" ")
print(new_word)
do_again()


def do_again():
print("Do you want to play again: 'y' for yes and 'n' for no ")
ans = input()
if (ans in "Yy"):
start()
elif (ans in "Nn"):
exit(0)
else:
print("Enter a valid input")
do_again()


print("Let's play a game. Give us a word and gibberish syllable. Using that we will translate your word to gibberish")
start()

def add_gibberish(word, gibl, gib2):
vowels = "AaEeIi0oUu"
flag = True
last - False
i = 0
while (i < len (word)):
if word[i] in vowels:
#traverse whole word
# if character in a word is vowel
if last == False:
if flag == True:
word = word [0:i] + gibl + word[i:len(word)]
# if last charcater was not vowel
#check if first occurence of vowel
#add gibberis
to the word
i = i + len(gibl) + 1
flag - False
last = True
else:
gib2 + word[i:len (word)]
word [0:i]
first occurence of vowel
i = i + len(gib2) + 1
word =
# if other than
last = True
else:
i = i + 1
else:
# if character is not vowel
last = False
# set last character was not vowel
i =i+ 1;
return word
def start():
gibl = input ("Enter first gibberish syllable: ")
gib2 = input ("Enter second gibberish syllable: ")
word = input ("Enter a word to translate: ")
new_word = add_gibberish(word, gibl, gib2)
print("Gibberish word is: ", end=" ")
print(new_word)
do_again()
def do_again():
print ("Do you want to play again: 'y' for yes and 'n' for no ")
ans = input()
if (ans in "Yy"):
start()
elif (ans in "Nn"):
exit(0)
else:
print("Enter a valid input")
do_again()
print ("Let's play a game. Give us a word and gibberish syllable. Using that we will
translate your word to gibberish")
start()
Transcribed Image Text:def add_gibberish(word, gibl, gib2): vowels = "AaEeIi0oUu" flag = True last - False i = 0 while (i < len (word)): if word[i] in vowels: #traverse whole word # if character in a word is vowel if last == False: if flag == True: word = word [0:i] + gibl + word[i:len(word)] # if last charcater was not vowel #check if first occurence of vowel #add gibberis to the word i = i + len(gibl) + 1 flag - False last = True else: gib2 + word[i:len (word)] word [0:i] first occurence of vowel i = i + len(gib2) + 1 word = # if other than last = True else: i = i + 1 else: # if character is not vowel last = False # set last character was not vowel i =i+ 1; return word def start(): gibl = input ("Enter first gibberish syllable: ") gib2 = input ("Enter second gibberish syllable: ") word = input ("Enter a word to translate: ") new_word = add_gibberish(word, gibl, gib2) print("Gibberish word is: ", end=" ") print(new_word) do_again() def do_again(): print ("Do you want to play again: 'y' for yes and 'n' for no ") ans = input() if (ans in "Yy"): start() elif (ans in "Nn"): exit(0) else: print("Enter a valid input") do_again() print ("Let's play a game. Give us a word and gibberish syllable. Using that we will translate your word to gibberish") start()
Enter your first Gibberish syllable (add * for the vowel substitute): i3
Syllable must only contain letters or a wildcard ('*'): ip
Enter the second Gibberish syllable (* for vowel substitute): *zz
Please enter a word you want to translate:
--> Gibberish
Your final word:
Gipibbezzerizzish
Play again? (y/n) m
Please enter y to continue or n to quit: n
Thanks for playing!
Transcribed Image Text:Enter your first Gibberish syllable (add * for the vowel substitute): i3 Syllable must only contain letters or a wildcard ('*'): ip Enter the second Gibberish syllable (* for vowel substitute): *zz Please enter a word you want to translate: --> Gibberish Your final word: Gipibbezzerizzish Play again? (y/n) m Please enter y to continue or n to quit: n Thanks for playing!
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY