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
aalyn [17]
3 years ago
15

Def pig_latin(word): """ ------------------------------------------------------- Converts a word to Pig Latin. The conversion is

: - if a word begins with a vowel, add "way" to the end of the word. - if the word begins with consonants, move the leading consonants to the end of the word and add "ay" to the end of that. "y" is treated as a consonant if it is the first character in the word, and as a vowel for anywhere else in the word. Preserve the case of the word - i.E. If the first character of word is upper-case, then the new first character should also be upper case. Use: pl = pig_latin(word)
Computers and Technology
1 answer:
Virty [35]3 years ago
5 0

def pig_latin(word):

   if word[0].lower() in 'aeiou':

       word = word + 'way'

   else:

       t=''

       for x in range(len(word)):

           if word[x].lower() in 'aeiou':

               break

           if word[x].lower() == 'y' and x>0:

               break

           else:

               t+=word[x].lower()

       if word[0].isupper():

           word = word[len(t):]+word[:len(t)].lower()+'ay'

           word = word.title()

       else:

           word = word[len(t):]+word[:len(t)].lower()+'ay'

   return word

word = 'test'

pl = pig_latin(word)

print(pl)

I wrote my code in python 3.8. I hope this helps.

You might be interested in
You have decided to remove a recently installed feature which method can you use to remove this feature
Aliun [14]
If it is on the desktop screen you just right click on the icon and select delete. from there if you're on a windows computer it goes to your recycle bin then you right click the recycle bin and a little rectangle pops up an in that rectangle it says clear recycle bin and once you press that all of the stuff that was in there is deleted. now if your on a computer that has chrome os installed you just go to the files screen and right click what you want to delete and click delete and it's gone. 
6 0
3 years ago
What is the ribbon in the word document
adoni [48]

Answer:

The Ribbon is a user interface element which was introduced by Microsoft in Microsoft Office 2007. It is located below the Quick Access Toolbar and the Title Bar. It comprises seven tabs; Home, Insert, Page layout, References, Mailing, Review and View. Each tab has specific groups of related commands

Explanation:

8 0
3 years ago
The closing of the letter should have at least
asambeis [7]

Answer:

Im unclear exactly what it is saying but i think its 2

7 0
3 years ago
Find true or false. A hacker is hacking software with access in sensitive information from your computer​
Alina [70]
ITS TRUE!!I SEARCHED IT
7 0
2 years ago
he transport layer on the destination host O reassembles the application message if it has been fragmented O removes the transpo
Dafna1 [17]

Answer: Both A and B

Explanation: Transport layer is the level of the OSI model which is helpful in maintaining the overall network communication.The application process that is being executed in the layers of architecture gets logical communication through transport layer.

It has the ability to connect the data that has been divided into section for the transportation.It can also act on the transport header ,which finds the transmission flow of specific data when not required.

4 0
3 years ago
Other questions:
  • MD5 uses a hash value to create a hash which is typically a 32 character hex number and how many bits?
    11·1 answer
  • What Is the output of the following: =OR (5 <7, 16*Rand ()>23,FALSE)
    5·1 answer
  • Suppose you are currently in the /home/hnewman/os/fall/2013 directory and would like to navigate to /home/hnewman/discreteStruct
    9·1 answer
  • Identify the six components of an information system. Which are most directly affected by the study of computer security? Which
    8·1 answer
  • Directory servers from different vendors are synchronized through ________.
    9·1 answer
  • What can you find the under the privacy policy section of a shopping website?
    12·1 answer
  • What is the working principle of computer?​
    10·1 answer
  • When creating any digital work, what is the MOST important thing to remember?
    7·1 answer
  • In this assignment you will be building an implementation of the hypothetical machine simulator like the one discussed in chapte
    5·1 answer
  • Radio spectrum is the part of the complete range of electromagnetic waves that is used for radio communication from
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!