Ronda (Confirmed)
Pre-Readings
Homework
Just like in the lesson, convert your own Pig Latin code from last week into a function in this form:
# Your function definition here
print(pig_latin(input("Enter input: ")))
Add the function we defined in the lesson to repeate words (repeat())to your code and call it to print the output from part 1a one hundred times.
The expected output for the input “praxis” should be “praxis praxis praxis …” (100 Praxes).
Modify your code in part 1a to split() the input into a list of multiple words. If there is only one word, it’ll just be a list with one element. Then, only print the Pig Latin for the first word. The Python documentation for a particualr string method will be very useful here!
As an example, the expected output for the input “praxis codelab code lab” should be “raxispay”.
Modify your code in part 1c to repeat just the first word in pig latin ten times, but also print the rest of the words after that.
As an example, the expected output for the input “praxis codelab code lab” should be “raxispay raxispay raxispay raxispay raxispay raxispay raxispay raxispay raxispay raxispay codelab code lab”.