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
baherus [9]
3 years ago
15

Your program Assignment Write a program that reads a sentence as input and converts each word to "Pig Latin". In one version of

Pig Latin, you convert a word by removing the first letter, placing that letter at the end of the word, and then appending "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:
xxTIMURxx [149]3 years ago
5 0

Answer:

theSentence = input('Enter sentence: ')

theSentence = theSentence.split()

sentence_split_list =[]

for word in theSentence:

  sentence_split_list.append(word[1:]+word[0]+'ay')

sentence_split_list = ' '.join(sentence_split_list)

print(sentence_split_list)

Explanation:

Using the input function in python Programming language, the user is prompted to enter a sentence. The sentence is splited and and a new list is created with this statements;

theSentence = theSentence.split()

sentence_split_list =[ ]

In this way every word in the sentence becomes an element in this list and individual operations can be carried out on them

Using the append method and list slicing in the for loop, every word in the sentence is converted to a PIG LATIN

The attached screenshot shows the code and output.

You might be interested in
Which of the following is most likely to own the data resulting from a research project?
fomenos

Answer:

Option C i.e., ODS/Data warehouse is the correct answer.

Explanation:

The following option is correct because ODS/Data warehouse owns that resulting data from that project which is related to research. ODS transfer the data of the database to the data warehouses before processing that data or information in the database which is collected from the different-different sources

4 0
3 years ago
What blank operating system is usually used in personal computers
LenaWriter [7]

The market of personal computers is dominated by Microsoft with their OS called Windows. Windows 10 and Windows 7 are most popular operating systems.

7 0
3 years ago
Describe a situation in a program where you could write and use a "for loop".​
kykrilka [37]

Answer:

  • Use the one that reads most clearly.
  • If you can’t decide, just pick one.
  • If you can’t then use for()
  • If at any point later in time you change your mind, refactor your code.

This is how professionals work. Decide, and for all things with low impact to change, don’t sweat it.

Save that for architectural and API design choices.

Answer#2:

  • Well if you are looking for a simple technique to choose which loop to use you can use these rules.
  • Use for loops when there's a sequence of elements that you want to iterate.
  • Use while loops when you want to repeat an action until a condition changes.

And if whatever you are trying to do can be done with either for or while loops then just choose your favourite :)

8 0
2 years ago
Read 2 more answers
7.
shusha [124]

Answer:

The answer is "4".

Explanation:

In this code, on line number 4, it will give the error message, and its correct solution can be defined as follows:

In this code, a variable "score" is declared, that holds a value that is 0, and in the next step, a method "onEvent" is declared that uses a method, and in the if block, it checks the "score" value that is less than 5 and it will print the message.

8 0
3 years ago
Describe the technology used in space exploration
OverLord2011 [107]
The technology used in space exploration are simple observation technologies such as cameras, recorders and other machines to study a certain place in the space. Also space exploration needs survival technology for the spacemen allowing them to survive for many many years.
5 0
3 years ago
Read 2 more answers
Other questions:
  • The RAM is a type of ____ a.Main Memory b.Secondary Memory c.Human Memory d.EPROM e.EEPROM
    13·2 answers
  • Select the proper ergonomic keyboarding techniques.
    9·1 answer
  • What are some of the good effects of social media
    7·1 answer
  • You are the manager and two employees are having issues with each other. These issues are affecting their happiness and producti
    11·1 answer
  • How are blogs and wiki alike
    15·2 answers
  • What kind of software program delivers advertising content in a manner that is unexpected and unwanted by the user, and is typic
    14·1 answer
  • In popular usage and in the media, the term ________ often describes someone who breaks into a computer system without authoriza
    10·1 answer
  • How to reduce hard drive failure data loss?
    13·1 answer
  • Why do we create user accounts to customize our preferences​
    10·1 answer
  • Data becomes _____ when it is presented in a context so that it can answer a question or support decision makin
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!