Python Programming Pig Latin is a language game in which English words are altered, usually by manipulating the position of the letters in words and/or adding suffixes/prefixes. Here are the rules so that you won't get lost in translation. 1. If a word starts with a consonant and a vowel, put the first letter of the word at the end of the word and add "ay." 2. If a word starts with two consonants move the two consonants to the end of the word and add "ay." 3. If a word starts with a vowel add the word "way" at the end of the word. Your task is: 1. To complete the piglatin_translate function. Input Format The input accepts phrases in string format. Constraints For simplicity, the input lines accept phrases that are in lower case and have no punctuations. These phrases only contain letters and spaces. Output Format The piglatin_translate method should return the translated version of the input phrase as a string. Sample Input 1 pig latin is hard to speak Sample Output 1 igpay atinlay isway ardhay otay eakspay Sample Input 2
Addition of Two Numbers
Adding two numbers in programming is essentially the same as adding two numbers in general arithmetic. A significant difference is that in programming, you need to pay attention to the data type of the variable that will hold the sum of two numbers.
C++
C++ is a general-purpose hybrid language, which supports both OOPs and procedural language designed and developed by Bjarne Stroustrup. It began in 1979 as “C with Classes” at Bell Labs and first appeared in the year 1985 as C++. It is the superset of C programming language, because it uses most of the C code syntax. Due to its hybrid functionality, it used to develop embedded systems, operating systems, web browser, GUI and video games.
Python Problem (see pic)
What I have done (so far): pls help!
Template:
![Python Programming
Pig Latin is a language game in which English words are altered, usually by manipulating the position of
the letters in words and/or adding suffixes/prefixes. Here are the rules so that you won't get lost in
translation.
1. If a word starts with a consonant and a vowel, put the first letter of the word at the end of the word and
add "ay."
2. If a word starts with two consonants move the twO consonants to the end of the word and add "ay."
3. If a word starts with a vowel add the word "way" at the end of the word.
Your task is:
1. To complete the piglatin_translate function.
Input Format
The input accepts phrases in string format.
Constraints
For simplicity, the input lines accept phrases that are in lower case and have no punctuations. These
phrases only contain letters and spaces.
Output Format
The piglatin_translate method should return the translated version of the input phrase as a string.
Sample Input 1
pig latin is hard to speak
Sample Output 1
igpay atinlay isway ardhay otay eakspay
Sample Input 2
my name is a very long string
Sample Output 2
myay amenay isway away eryvay onglay ringstay
# Template
3 vdef piglatin_translate (phrase):
4.
""Translates a phrase into Pig Latin."""
"-_main__":
input line str(input())
print (piglatin_translate (input line))
6 vif name_ ==
11
8](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F12d77f8e-7de7-47da-bc37-8476c268516a%2Fc236af30-9756-4c47-83c2-c27c2ffa8517%2Fqkdov4_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)