For intro to python class

Assignment Help Business Management
Reference no: EM131675785

For Intro to Python Class.

Pig Latin is a language game in which words are altered according to certain rules. 

To make the pig latin form of an English word, 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. The letter "y" counts as a consonant. If there are no vowels, simply append "ay" to the end of the word. 

For example: 

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

(a) In the file problem1.py, write a function

def piggify(word):...

that takes an input String word as its parameter and returns a string containing the pig latin translation of the word. You can assume that the input is always a lower-case string (no input verification is necessary). 

Hints: Use indexing and slicing. You might also want to use a string of vowels and then use the in operator to check if a letter is a vowel.

vowels = 'aeiou'

(b) In the same file, write a program that repeatedly prompts the user to input a new word and then prints the pig latin translation of the word (by calling the piggify function). When the user types a single period, the program should quit.

Reference no: EM131675785

Questions Cloud

Production schedule for the factory : A computer system that relies on extensive data input to produce a production schedule for the factory and a schedule of needed raw materials is what kind?
What happens to total production and consumption : Trade at Negotiated Mid-Price. The mid-price for exchange between France and China can be calculated as follows.
Sequence of the four nucleotide bases : DNA molecules consist of a sequence of the four nucleotide bases: adenine, thymine, cytosine, and guanine. The nucleotide bases are often abbreviated.
Define the teletransporter or the spaceship : Which option would you choose: the teletransporter or the spaceship. Explain why. Which of the four criteria of personal identity discussed
For intro to python class : Pig Latin is a language game in which words are altered according to certain rules.
Distinctions in international and multinational companies : Trident's Globalization. After reading the chapter's description of Trident's globalization process, how would you explain the distinctions.
Identify at least two types of feedback : What is the difference between effective praise and ineffective praise? How is praise the same or different than feedback?
Challenges to resolving controversy of personal information : It's about profession ethics. What are some unique challenges to resolving controversy of personal information collection
Limitations of comparative advantage : Limitations of Comparative Advantage. Key to understanding most theories is what they say and what they don't. Name four or five key limitations to the theory.

Reviews

Write a Review

Business Management Questions & Answers

  Learning module explores violence

This learning module explores violence, terrorism, and war. In this assignment, you will apply the concepts from this module in a discussion activity about the moral implications of media violence and its affect on society. Read the chapter on violen..

  Complete personal model of leadership

Write a paper of 1,250-1,500 words that presents your complete personal model of leadership. Be sure to incorporate the instructor's feedback from the draft of Part 1. The 2 parts involved in creating your personal model of leadership are as follo..

  Explain athy owes six unpaid movies to her local video store

Athy owes six unpaid movies to her local video store. Since each of Cathy's overdue videos is a comedy only comedies

  Risk management tool at a project management

As in Project Management aspect. Select ONE risk management tool at a Project Management's disposal, and then:

  Define relationship-based theories of leadership

Define relationship-based theories of Leadership. Identify the three major eras in the study of leadership and their contributions to modern leadership.

  Do manufactures of products for children

Do manufactures of products for children have special responsibilities to consumers and society? If do what are these errands?

  How investment-oriented the company is as well as cite

write a one-page memo on how investment-oriented the company is as well as cite your supporting evidence. By investment-oriented

  Explanation of implied consent and expressed consent

Assignment Description: Your department has just hired several new employees. The manager of the department has asked you to develop a privacy training program on the "Notice of Privacy Practices" and "Patient Rights" for the new employees. Step O..

  How does the product or service meet the consumer needs

How does the product or service meet the consumer needs? What are the specific benefits of the product or service from the customers' perspective?

  Questionfaxco incorporated is a corporate with 500

questionfaxco incorporated is a corporate with 500 employees. the ceo of the corporation has recently learned based on

  Analyze the history of changes in gdp

Analyze the history of changes in GDP, savings, investment, real interest rates, and unemployment and compare to forecast for the next five years.

  Decide correctly on strategic procurement

Decide correctly on strategic procurement. Obtain correct information to enable sound business decisions Leverage the companies purchasing power to obtain.

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