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
Blababa [14]
3 years ago
8

You are given an integer N, followed by N lines of input (1 <= N <= 100). Each line of input contains one or several words

separated with single spaces. Each word is a sequence of letters of English alphabet containing between 1 and 10 characters, inclusive. The total number of words in the input is between 1 and 100, inclusive
Your task is to reverse the order of words in each line of input, while preserving the words themselves. The lines of your output should not have any trailing or leading spaces.
Computers and Technology
1 answer:
Fittoniya [83]3 years ago
3 0

Answer:

Python 3 code:

n = int(input())

rev_str = [ ]

for i in range(n):

   s = str(input())

   s.split()

   words = s.split(' ')

   string = [ ]

     

   for word in words:

       string.insert(0, word)

 

   rev_str.append(" ".join(string))

     

   #print(" ".join(string))

for i in range(len(rev_str)):

   print(rev_str[i])

Explanation:

You might be interested in
Someone, please answer this.
Sav [38]

Answer: A loop will continue running until the defined condition returns false . ... You can type js for , js while or js do while to get more info on any of these. ... initialization - Run before the first execution on the loop. ... But it can be used to decrement a counter too. statement - Code to be repeated in the loop.

Explanation:

7 0
3 years ago
What features could be improved in microsoft word?
Korolek [52]

Word (and the rest of the Office suit) suffers from feature creep and legacy cruft. This is a difficult problem because with so many users, removing features is impossible without upsetting a lot of people.

One option would be to split Word into two products: One, called Word, would be a completely new product with a clear focus on the experience of writing and formatting text. This would require ruthlessly cutting out any parts that don't support this goal, including some backwards compatibility.

The other product, called Word Classic, would maintain all the cruft that some people feel they might need. Since the experience would be so much worse, and the new Word would be more prominently displayed in the Office suit, this would help Word users gradually transition to the new product.

7 0
3 years ago
Which of the following are cloud computing resources?
aleksandr82 [10.1K]
All of the above because it is accessible through computer access if you were to download them to any type of iCloud work
3 0
3 years ago
Read 2 more answers
In this exercise, you will write a class that represents how you spend your time during the week The class should have four doub
Nuetrik [128]

Answer:

Answered below

Explanation:

# Program is written in Java

class WeekHours{

double school;

double fun;

double sleep;

double sports;

WeekHours( ){

school = 0.0;

fun = 0.0;

sleep = 0.0;

sports = 0.0;

}

public void setSchool ( double x){

school = x;

}

public void setFun( double y){

fun = y;

}

public void setSleep( double w){

sleep = w;

}

public void setSports( double z){

sports = z;

}

public void totalHours(){

double tHours = school + fun + sleep + sports;

System.out.print(tHours);

}

}

4 0
3 years ago
2. What are some other reasons why you might need to know the operating system version on your computer or mobile device
mote1985 [20]
1. To check compatibility of an app/ software
2. To know the vulnerabilities
3. To be aware of available system updates
Hope that helps
7 0
2 years ago
Other questions:
  • How do all apple phones work?
    7·1 answer
  • What is the function of a data bus
    11·1 answer
  • Which of the following best describes the Distribution Mix?
    15·1 answer
  • A Linux-based OS is called a _____.
    9·1 answer
  • Consider the following code: String word [] = {"algorithm", "boolean", "char", "double"}; for ( int i =0; i &lt; word.length/2;
    11·2 answers
  • What does this say in morse code?
    11·2 answers
  • Many electronic devices use a(n) ?, which contains all the circuit parts in a miniature form.
    14·2 answers
  • Need the answer ASAP!!! I’ll mark brainliest if correct
    12·2 answers
  • What type is the combination of an integer and a string
    13·1 answer
  • Answer pls pls pls pls ​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!