Write a function is_consonant that takes a character and returns True if it is a consonant. Use your function to create a new function to_piglatin that takes a word, moves all starting consonants (all consonants before the first vowel) to the end of the word, then adds ay to the end and returns the result. You may expect that the input to the function will be just one word. (we know this isn't true pig latin - please do not change this basic algorithm). For a single word input the first letter is capitalized and the rest are lower case as shown in the example below. Examples: (format is: function call -> returns) - do not return this whole string just return the word after the arrow. to_piglatin('stay') -> Aystay to_piglatin('Jared') -> Aredjay to_piglatin('and') -> Anday to_piglatin('CAR') -> Arcay

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.4: A Case Study: Rectangular To Polar Coordinate Conversion
Problem 9E: (Numerical) Write a program that tests the effectiveness of the rand() library function. Start by...
icon
Related questions
Question

please code in python

Write a function is_consonant that takes a character and returns True if it is a consonant.

Use your function to create a new function to_piglatin that takes a word, moves all starting consonants (all consonants before the first vowel) to the end of the word, then adds ay to the end and returns the result. You may expect that the input to the function will be just one word. (we know this isn't true pig latin - please do not change this basic algorithm). For a single word input the first letter is capitalized and the rest are lower case as shown in the example below.

Examples:

(format is: function call -> returns) - do not return this whole string just return the word after the arrow. to_piglatin('stay') -> Aystay

to_piglatin('Jared') -> Aredjay

to_piglatin('and') -> Anday

to_piglatin('CAR') -> Arcay

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Function Arguments
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr