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
* Describe the five components of a<br> computer
LenaWriter [7]

Answer:

Computer systems consist of three components as shown in below image: Central Processing Unit, Input devices and Output devices. Input devices provide data input to processor, which processes data and generates useful information that's displayed to the user through output devices. This is stored in computer's memory.

5 0
2 years ago
Read 2 more answers
Now you are ready to implement a spell checker by using or quadratic. Given a document, your program should output all of the co
Harlamova29_29 [7]

Answer:

Sorry po idont know po ehhh sorry

5 0
3 years ago
Will somebody please explain to me HTML?
larisa86 [58]

Answer:

Hypertext Markup Language (is also known as html) is the standard markup language for creating web pages and web applications.

3 0
3 years ago
A VALENTINE
-Dominant- [34]

Answer:

i dont see the image

Explanation:

6 0
3 years ago
Read 2 more answers
Format Painter is used to copy formatting from one location to another.<br> true<br> false
Readme [11.4K]
True

Hope this helps!
4 0
3 years ago
Other questions:
  • Which payment type is best if you are trying to sick to a budget?
    15·1 answer
  • Which of the following statements is true of ASCII code?
    12·1 answer
  • #We've started a recursive function below called #measure_string that should take in one string parameter, #myStr, and returns i
    5·1 answer
  • jeff wants to create a website with interactive and dynamic content. Which programming language will he use?
    11·2 answers
  • 2. What is an inanimate object? (1.0 points)
    14·1 answer
  • An index purports to speed data retrieval. you, therefore, index every attribute in each table. select the likely consequence.
    15·1 answer
  • What is the purpose of the operating system's processor management function?
    14·1 answer
  • private int product(int n) { if(n &lt;= 1) return 1; else return n * product(n-2); } What is the output when product(6) is calle
    6·1 answer
  • . Define the process of Technological relationship
    12·1 answer
  • Helppppppppppppppppppppppppppppppppp
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!