1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Sliva [168]
3 years ago
8

Write a function getPigLatin(pigStr) that accepts pigStr as a parameter (a sentence as input) and converts each word to "Pig Lat

in." and returns the entire string in Pig Latin. In one version, to convert a word to Pig Latin, you remove the first letter and place that letter at the end of the word. Then, you append the string "ay" to the word. Here is an example:
English: I SLEPT MOST OF THE NIGHT


Pig Latin: IAY LEPTSAY OSTMAY FOAY HETAY IGHTNAY
Computers and Technology
1 answer:
Vladimir79 [104]3 years ago
8 0

Answer:

userInput = str(input("Enter your sentence here.\n")).upper()

def getPigLatin(userInput):

   splitInput = userInput.split(" ")

   newList = []

   for word in splitInput:

       firstLetter = word[0]

       if len(word) == 1:

           word += 'AY'

           newList.append(word)

       else:

           word = word.strip(word[0])

           word += firstLetter

           word += 'AY'

           newList.append(word)

   print(*newList, sep= " ")

getPigLatin(userInput)

Explanation:

This solution is done in Python

First the user is prompt to enter a statement, the statement converted to string and also capitalize using str and upper() built-in function. The user input is assigned to userInput variable.

The getPigLatin function is defined and it accept a string as parameter. Inside the getPigLatin function, the userInput is splitted and assigned to splitInput variable.

An empty list is also initialized and assigned to newList. Next, we loop through the splitInput. During the loop; we first check if the length of an element is one, then we just add 'AY' to the element and add the element to the newList. Else, if the element length is more than one; we strip the first letter from the word and also re-assign it to word, then the stripped first letter is added to the end of the word. Next, 'AY' is added to the word and the element is add to the newList.

The last line of the getPigLatin function display the entire element of the list using a space seperator.

The last line of the entire solution call the function passing in the userInput as argument.

You might be interested in
A company needs to store its documents in one place, share news and information with all staff, and allow access for employees w
Greeley [361]
An NAS
Would do The Trick
4 0
2 years ago
What kind of resources can we share over the network? Plzzzzzzzz help!!!!!!
lubasha [3.4K]

Sharing network resources requires abiding by certain constraints, as follows:

<span>Security: Organizations present ongoing opportunities for unauthorized shared resources. Security mechanisms should be implemented to provide efficient parameters.Compatibility: Various client-server operating systems may be installed, but the client must have a compatible OS or application to access shared resources. Otherwise, the client may encounter issues that create communication delays and requires troubleshooting.Mapping: Any shared OS hardware drive, file or resource may be accessed via mapping, which requires a shared destination address and naming conventions.<span>File Transfer Protocol (FTP) and File Sharing: FTP is not affected by shared resources because the Internet is FTP’s backbone. File sharing is an LAN concept.</span></span>
3 0
3 years ago
Read 2 more answers
Which statement best describes the Tell Me feature in PowerPoint 2016?
Bumek [7]

A statement best describes the Tell Me feature in PowerPoint 2016 is that: D. it opens a search field that can be used to look up old versions of presentations.

<h3>What is PowerPoint 2016?</h3>

PowerPoint 2016 refers to a software application that was designed and developed by Microsoft Inc., so as to avail its end users the ability to create various slides which can be used during a presentation.

In PowerPoint 2016, the Tell Me feature is a tool which opens a search field that can be used by end users to look up or search old versions of presentations.

Read more on PowerPoint here: brainly.com/question/26404012

#SPJ1

6 0
1 year ago
Theodor is researching computer programming. He thinks that this career has a great employment outlook, so he’d like to learn if
Ronch [10]

The skills that are vital are:

  • Analytical skills to troubleshoot problems for clients.
  • The concentration and focus to be able to study and write computer code.

<h3>What are analytical and problem solving skills? </h3>

This is known to be the  ability of a person to be able to look into information in-depth so as to  tell the key or important elements, its strengths and weaknesses and others.

Therefore, The skills that are vital are:

  • Analytical skills to troubleshoot problems for clients.
  • The concentration and focus to be able to study and write computer code.

Learn more about Analytical skills from

brainly.com/question/2668962

#SPJ1

7 0
1 year ago
Higher resolution images mean they can be enlarged better, <br> True or false
ella [17]

Answer:

False

Explanation:

High resolution just mean It looks better

6 0
3 years ago
Read 2 more answers
Other questions:
  • When does a kernel panic occur?
    12·2 answers
  • What is life all about?
    15·2 answers
  • Which three phrases describe a wireframe
    12·1 answer
  • What is the definition of a server?
    11·1 answer
  • When you are given a set of tables and asked to create a database to store their data, the first step is to ________?
    8·1 answer
  • What are control layouts? What are the two primary control layout options?
    13·1 answer
  • Which result is most likely if a network packet has no header?
    9·2 answers
  • ARGENT !!20 POINTS <br> А ________ translates commands from a computer to draw lines on paper.
    10·2 answers
  • what impact of information communication technology have on the environment about electronic waste, use of electricity?​
    9·1 answer
  • [2]<br> (c) Describe how the microprocessor can determine when to sound the clock alarm.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!