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]
2 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]2 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
It keeps saying “something is going wrong oops!” when i click on my brainly notifications what do I do
AveGali [126]

Answer:

check your app permissions it may be blocking them or try resetting the app

4 0
3 years ago
 What should every Software Engineer know about Software Architecture? ”<br> ??
Llana [10]
<span>Answer: -Software architecture isn't about big design up front; -Every software team needs to consider software architecture; -The software architecture role is about coding, coaching and collaboration; -You don't need to use UML; -A good software architecture enables agility.</span>
7 0
2 years ago
Data is removed at the back of the queue.a) trueb) false
alexdok [17]

Answer:

true

Explanation:

4 0
3 years ago
Select from the following list of tags those whose information is not explicitly displayed on a web page. ( multiple answers)
zimovet [89]
D wound not work in things like html because it does not exist
4 0
3 years ago
A computer connected to the internet that asks for data is a ________. aggregator surrogate server client
Tems11 [23]
The answer to this question would be client.

Client is the computer that most people use. When you browsing a web using the internet, your computer will ask for data from the web server and the data will be arranged into graphical picture or words what you see on your monitor. Server is the computer that gives data the client ask for.
3 0
3 years ago
Other questions:
  • Your boss in the human resources department asks you to write a function that calculates the length of time that employees have
    6·1 answer
  • Proxy data:
    12·1 answer
  • In windows xp, which control panel icon should you choose if you would like to customize your system for left-handed use?
    7·2 answers
  • What is the maximum input current fr transformer T10266
    10·1 answer
  • Explain how arrays are stored in memory? Show how arr [5] is stored in the memory. Assume each memory location is one byte long
    6·1 answer
  • Which are examples of non-linear presentations? Choose all that apply.
    11·1 answer
  • Lucy has to move data from column A to column N in a worksheet. Which keys should she select to move data in the same worksheet?
    9·2 answers
  • Write assembly programs with the following I/O
    15·1 answer
  • Which type of loan is based on financial need
    6·1 answer
  • READ CAREFULLY! There is a difference between moving and copying files.a. Create a directory named . For example, mine would be
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!