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
Tina has made a database table in access containing field name class roll number and contact number she has set primary key for
Andrej [43]

Answer:

the answer is B for plato users

Explanation:

5 0
3 years ago
In the event that a software product fails within a predetermined. Clients use a​
Musya8 [376]

Answer:

try to update product software it will working

Explanation:add license product of a software

5 0
4 years ago
What mode is generally used when delivering a presentation to an audience?
dybincka [34]

Answer:

delivery mode

Explanation:

there it is

7 0
3 years ago
Read 2 more answers
While the concept of ____ has well served scientists who share scientific text files and application developers who exchange cod
Marta_Voda [28]

Answer: peer-to-peer (P2P) file sharing

Explanation: Peer-to-peer file sharing is the technique in which networking technology is used for the sharing and distribution of the files digitally. The sharing of the files are in the form of movies, games music etc.

Peer are considered as the nodes which are the end-user so, the end-user to end-user file transfer is done through this technology.

Other options are incorrect because VPN(virtual private network) is the connection between network and client over less secure network,LAN (Local area network) is the network that can be established for single infrastructure to connect  and point to point protocol is protocol for the routers for communication.Thus the correct option is P2P file sharing.

7 0
3 years ago
In the ________ step the data is either written to the file or read from the file.
nexus9112 [7]
I believe the step is <span>Insertion </span>
7 0
3 years ago
Other questions:
  • A search engine displays a list of webpage names that contain the search text. what is the term for that list?
    14·1 answer
  • Fill in the missing statements or expressions in the following code that checks to ensure that a user enters an integer value at
    11·1 answer
  • Splunk In most production environments, _______ will be used as the source of data input?
    12·1 answer
  • Once your hard drive is installed what needs to be done to the drive and what do these two tasks do
    12·1 answer
  • Symbic Foods, a chain of fast food restaurants, has included a drop-down menu on its main Web site. With this drop-down menu, pe
    13·1 answer
  • In a cross-site request forgery, what components help send a forged HTTP request? In a cross-site request forgery, browser _____
    13·1 answer
  • Por qué el entorno gráfico de Windows es amigable con el hombre ?
    14·1 answer
  • AI structure question. Please help
    9·1 answer
  • We initialize the parameters to all zero values and run the linear perceptron algorithm through these points in a particular ord
    8·1 answer
  • Question 2 if you have a slow computer, what are some possible culprits that could be causing this? select all that apply
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!