Revorse the vewels def reverse_vowels(text): Given a text string, create and return a new string constructed by finding all its vowels (in this problem, 'aeiouAEIOU") and reversing their order, while keeping all other characters exactly as they were in their original positions. Furthermore, the capitalization of each position must remain the same as it was in the original text. For example, reversing the vowels of 'Ilkka' should produce 'Alkki' instead of 'alkkI'. Results of applying this operation to perfectly ordinary English sentences often comically resemble pig latin imitations of other languages. Along with many possible ways to perform this dance, one straightforward way to reverse the vowels starts by appending the vowels of text into a separate list, and initializing the result to an empty string. Then, loop through all characters of the original text. Whenever the current character is a vowel pop one from the end of the list of the vowels. Convert that vowel to either upper- or lowercase depending on the case of the vowel that was originally in that position, and add it to result. Otherwise, add the character from the original text to the result as it was. text Expected result "Revorse the vewels' "Reverse the vowels' "Bengt Hilgursson' "Bongt Hulgirssen' "Why do you laugh? I chose the why da yee leogh? I chusa thu death.' dooth. "These are the people you protect vith your paini" "Thisa uro thi peoplu yoe protect weth year peeni" "who's the leader of the club "Whi's thi liider af thu clob that's made for you and me? T- thot's mude fer yeo end u? T- R-I-C-K-Y M-0-U-S-EI Tricky Mousel TRICKY MOUSEI Tricky Mousel TRICKY MOUSEI Forever let us hold our Hammers highi Highi Highi Highi" R-0-C-K-Y M-I-E-S-UI Trocky Miesul TROCKY MIESUI Trocky Miesul TROCKY MIESAI Furovor let as hald uer Hommera haghi Heghi Heghi Hoghi"
Revorse the vewels def reverse_vowels(text): Given a text string, create and return a new string constructed by finding all its vowels (in this problem, 'aeiouAEIOU") and reversing their order, while keeping all other characters exactly as they were in their original positions. Furthermore, the capitalization of each position must remain the same as it was in the original text. For example, reversing the vowels of 'Ilkka' should produce 'Alkki' instead of 'alkkI'. Results of applying this operation to perfectly ordinary English sentences often comically resemble pig latin imitations of other languages. Along with many possible ways to perform this dance, one straightforward way to reverse the vowels starts by appending the vowels of text into a separate list, and initializing the result to an empty string. Then, loop through all characters of the original text. Whenever the current character is a vowel pop one from the end of the list of the vowels. Convert that vowel to either upper- or lowercase depending on the case of the vowel that was originally in that position, and add it to result. Otherwise, add the character from the original text to the result as it was. text Expected result "Revorse the vewels' "Reverse the vowels' "Bengt Hilgursson' "Bongt Hulgirssen' "Why do you laugh? I chose the why da yee leogh? I chusa thu death.' dooth. "These are the people you protect vith your paini" "Thisa uro thi peoplu yoe protect weth year peeni" "who's the leader of the club "Whi's thi liider af thu clob that's made for you and me? T- thot's mude fer yeo end u? T- R-I-C-K-Y M-0-U-S-EI Tricky Mousel TRICKY MOUSEI Tricky Mousel TRICKY MOUSEI Forever let us hold our Hammers highi Highi Highi Highi" R-0-C-K-Y M-I-E-S-UI Trocky Miesul TROCKY MIESUI Trocky Miesul TROCKY MIESAI Furovor let as hald uer Hommera haghi Heghi Heghi Hoghi"
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
![Revorse the vewels
def reverse vowele(text):
Given a text string, create and return a new string constructed by finding all its vowels (in this
problem, 'aeiouAEIOU') and reversing their order, while keeping all other characters exactly as
they were in their original positions. Furthermore, the capitalization of each position must remain
the same as it was in the original text. For example, reversing the vowels of 'Ilkka' should
produce 'Alkki' instead of 'alkkI'. Results of applying this operation to perfectly ordinary
English sentences often comically resemble pig latin imitations of other languages.
Along with many possible ways to perform this dance, one straightforward way to reverse the
vowels starts by appending the vowels of text into a separate list, and initializing the result to
an empty string. Then, loop through all characters of the original text. Whenever the current
character is a vowel, pop one from the end of the list of the vowels. Convert that vowel to either
upper- or lowercase depending on the case of the vowel that was originally in that position, and add
it to result. Otherwise, add the character from the original text to the result as it was.
text
Expected result
'Revorse the vewels
'Reverse the vowels'
'Bengt Hilgursson'
'Bongt Hulgirssen'
'Why do you laugh? I chose the 'Why da yee leogh? I chusa thu
death."
dooth.'
"Thisa uro thi peoplu yoe
protect weth year peenl'
"These are the people you
protect with your painl'
"who's the leader of the club
that's made for you and me? T- thot's mude fer yeo end mu? T-
R-1-C-К-х М-0-0-5-EI Tricky
Mousel TRICKY MOUSEI Tricky
Mousel TRICKY MOUSEI Forever
let us hold our Hammers highi
Highl Highl Highl"
"Whi's thi liider af thu clob
R-0-с-к-х м-1-E-S-01 Trocky
Miesul TROCKY MIESUI Trocky
Miesul TROCKY MIESAI Furovor
let as hald uer Hommers haghi
Heghi Heghi Hoghl"](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F886e41a3-9447-40ef-9864-5f77f8e5f654%2F141fa84d-bfe0-4fd4-ac64-0bea83736f02%2F81x0y44_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Revorse the vewels
def reverse vowele(text):
Given a text string, create and return a new string constructed by finding all its vowels (in this
problem, 'aeiouAEIOU') and reversing their order, while keeping all other characters exactly as
they were in their original positions. Furthermore, the capitalization of each position must remain
the same as it was in the original text. For example, reversing the vowels of 'Ilkka' should
produce 'Alkki' instead of 'alkkI'. Results of applying this operation to perfectly ordinary
English sentences often comically resemble pig latin imitations of other languages.
Along with many possible ways to perform this dance, one straightforward way to reverse the
vowels starts by appending the vowels of text into a separate list, and initializing the result to
an empty string. Then, loop through all characters of the original text. Whenever the current
character is a vowel, pop one from the end of the list of the vowels. Convert that vowel to either
upper- or lowercase depending on the case of the vowel that was originally in that position, and add
it to result. Otherwise, add the character from the original text to the result as it was.
text
Expected result
'Revorse the vewels
'Reverse the vowels'
'Bengt Hilgursson'
'Bongt Hulgirssen'
'Why do you laugh? I chose the 'Why da yee leogh? I chusa thu
death."
dooth.'
"Thisa uro thi peoplu yoe
protect weth year peenl'
"These are the people you
protect with your painl'
"who's the leader of the club
that's made for you and me? T- thot's mude fer yeo end mu? T-
R-1-C-К-х М-0-0-5-EI Tricky
Mousel TRICKY MOUSEI Tricky
Mousel TRICKY MOUSEI Forever
let us hold our Hammers highi
Highl Highl Highl"
"Whi's thi liider af thu clob
R-0-с-к-х м-1-E-S-01 Trocky
Miesul TROCKY MIESUI Trocky
Miesul TROCKY MIESAI Furovor
let as hald uer Hommers haghi
Heghi Heghi Hoghl"
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education