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
Outside of a C program, a file is identified by its ________while inside a C program, a file is identified by a(n) ________. fil
Alexxandr [17]

Answer: name, file stream object

Explanation:

4 0
2 years ago
What type of device is characteristic of an enterprise environment? Question 14 options: a) A workstation used by a retired pers
sertanlavr [38]

Answer:

A workstation used at an engineering firm is characteristic of an enterprise environment.

4 0
3 years ago
2) What is the value stored in the variable z by the statements below?
Dmitriy789 [7]

Answer:

7

Explanation:

Because the q.length is a inbuilt function in the programming which used to get the length of the array. In the array, there are 7 values are store. Therefore, the size 7 store in the variable z.

For example:

int[] array={1,2};

int x = array.length;

the answer of above code is 2, because the elements present in the array is 2.

 

5 0
3 years ago
A___________is a collection of computer software, typically malicious, designed to enable access to a computer or an area of its
Molodets [167]

Answer: rootkit

Explanation:

Hi, A rootkit is a collection of computer software, typically malicious, designed to enable access to a computer or an area of its software that is not otherwise allowed (for example, to an unauthorized user) and often masks its existence or the existence of other software.

A rootkit provides continued privileged access to a computer while hiding its presence. Because of this hiding characteristic it is very difficult to detect.

Once a rootkit has been installed, it allows someone to have total remote control of a computer and do things such as files executions and system changes.

4 0
3 years ago
What does the poster exemplify?
zloy xaker [14]

Answer:

try D

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • When the tcp\ip translates a network layer address into a data link layer address (after not finding an entry for the network la
    13·1 answer
  • What's the 16-bit hexadecimal representation of the signed decimal integer, -331? Answeers?
    14·1 answer
  • Which best explains what a credit score represents
    10·2 answers
  • MIDI is a A.technology based on placing brief digital recordings of live sounds under the control of a synthesizer keyboard. B.t
    10·1 answer
  • Describe the dynamic Network Address Translation (NAT).
    9·1 answer
  • How do you merge on excel?​
    5·1 answer
  • Edhesive unit 4 test answers
    15·1 answer
  • Explain what 10CLS program does and the write the output​
    13·1 answer
  • Difine the term pigment​
    14·3 answers
  • after teaching a group of students about measuring systems and drug calculations, the instructor determines that the teaching wa
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!