When called with no additional arguments

Assignment Help Basic Computer Science
Reference no: EM131979307

Please help with the following programming, using python 3 :

Pig Latin is a game of alterations played on words. To translate an English word into Pig Latin, the initial consonant sound is transposed to the end of the word and an "ay" is affixed. Specifically, there are two rules:

  • If a word begins with a vowel, append "yay" to the end of the word.
  • If a word begins with a consonant, remove all the consonants from the beginning up to the first vowel and append them to the end of the word. Finally, append "ay" to the end of the word.

For example,

  • dog => ogday
  • scratch => atchscray
  • is => isyay
  • apple => appleyay

Design a function that takes one argument, a string, and returns a string with each word in the argument translated into Pig Latin.

Hints:

  • The split method, when called with no additional arguments, breaks a string into words, and returns the words in a list.
  • Slicing is your friend: it can pick off the first character for checking, and you can slice off pieces of a string and use string concatenation (the + operator) to make a new word.
  • Making a string of vowels allows use of the in operator: vowels="aeiou" (how do you make this work with both upper and lower case?)
  • Test your function with a diverse range of examples. Your tests should cover all cases (for example, test words beginning with a vowel and words beginning with a consonant). Pay particular attention to edge cases (for example, what happens if the word consists of just one vowel, like "a"? what happens if the string is empty?).

Reference no: EM131979307

Questions Cloud

Who are the top three competitors of nike : Who are the top three competitors of Nike, and what are their advantages/disadvantages with respect to their product/service development?
Advantage of the shared physical resources : He then takes advantage of the shared physical resources to steal data. Which of the following describes this attack?
Conduct research to locate three sample pivot tables : Conduct research to locate three sample pivot tables. Post the tables or links to the tables in the Main Forum.
Prepare a positioning statement in given case : Prepare a positioning statement. Include a perceptual map that shows your company's position against its competitors. From this map, create a statement.
When called with no additional arguments : The split method, when called with no additional arguments, breaks a string into words, and returns the words in a list.
Performs the perfect shuffle on the list : Using python 3 design a function perfect_shuffle_in_place(a_list) which takes as argument a list and performs the perfect shuffle on the list.
Basis for other similar workbooks : 1. A(n) ________ is a workbook that you create to use as a basis for other similar workbooks.
What is the inversion of and gate : To symbolize the inversion of the output signal, the logic gate has a bubble on the output line. What is the inversion of AND gate. Picture please.
Performing encryption at the disk-block level : What are the advantages of performing encryption at the disk-block level, below the file system? (Mark all that apply.)

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Design an alternative custom visualization of the return

Design an alternative custom visualization of the return value from family Tree ().

  Define the states of the system

Define the states of the system; obtain the equilibrium equations for the state probabilities; find the probability generating function, and by differentiation of this function obtain the mean value of the number in the system.

  Economics underlying the response in the economy

Explain what happens to economic activity in the short run. What is the economics underlying the response in the economy?

  Deterministic finite automaton

1. Consider the deterministic finite automaton M = ({q1, q2, q3}, {0, 1}, ∂, q1, {q2}) where is dened as follows:

  Determine the quantity of mortar needed for the wall

Determine the quantity of mortar needed for the wall in Problem if 7.5 cubic feet of mortar is required per 100 square feet of brick.

  Elements corresponding to the inorder sequence

Suppose that you are given two sequences of elements corresponding to the inorder sequence and the preorder sequence. Prove that it is possible to reconstruct a unique binary tree .

  Identify and briefly describe four types of b2b web sites

What business functions are performed by e-procurement software? Why might an organization attempt to build its own e-procurement software rather than use existing software packages to meet these needs?

  Social implications of spending

What are the social implications of spending so many hours inside a virtual world? (5 lines at least)

  Find the coordinates of its foci

You Decide Manuel says that the graph of 3y - 36 = 2x2 - 18x is an ellipse with its major axis parallel to the y-axis. Shanice disagrees. Who is correct? Explain your answer.

  Draw an erd to model this situation

The local city youth league needs a database system to help track children that sign up to play soccer. Data needs to be kept on each team and the children that will be playing on each team and their parents.

  Generate a random number for the user and for the monster

I have been trying for days to figure out how to get this working, but have yet to succeed in doing so. Can some please help me with this?

  Find the association rule with the greatest lift

Compare the results from Exercise 13 with the results from the EDA and decision tree analysis in Chapters 3 and 6. Discuss similarities and differences. Which analysis format do you prefer? Do you find a confluence of results?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd