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
Can you exclude header rows from sort in excel?
Ad libitum [116K]

Answer:

The easiest way to sort excluding first row must be unselecting the first row. keys simultaneously to quickly select the data range from the second row to the end. Then you can sort the data excluding first row.

Explanation:

yes

4 0
3 years ago
Imagine that a team of scientists test a certain hypothesis, and the experimental results show that it is false.
andrew-mc [135]

Answer:

They would have had to retry and go back to experimenting.

4 0
3 years ago
Use the following cell phone airport data speeds​ (Mbps) from a particular network. Find P10. 0.1 0.1 0.3 0.3 0.3 0.4 0.4 0.4 0.
sasho [114]

Answer:

P_{10} =0.1

Explanation:

Given

0.1, 0.1, 0.3, 0.3, 0.3, 0.4, 0.4, 0.4, 0.6, 0.7, 0.7, 0.7, 0.8, 0.8

Required

Determine P_{10}

P_{10} implies 10th percentile and this is calculated as thus

P_{10} = \frac{10(n+1)}{100}

Where n is the number of data; n = 14

P_{10} = \frac{10(n+1)}{100}

Substitute 14 for n

P_{10} = \frac{10(14+1)}{100}

P_{10} = \frac{10(15)}{100}

Open the bracket

P_{10} = \frac{10 * 15}{100}

P_{10} = \frac{150}{100}

P_{10} = 1.5th\ item

This means that the 1.5th item is P_{10}

And this falls between the 1st and 2nd item and is calculated as thus;

P_{10} = 1.5th\ item

Express 1.5 as 1 + 0.5

P_{10} = (1 +0.5)\ th\ item

P_{10} = 1^{st}\ item +0.5(2^{nd} - 1^{st}) item

From the given data; 1st\ item = 0.1 and 2nd\ item = 0.1

P_{10} = 1^{st}\ item +0.5(2^{nd} - 1^{st}) item becomes

P_{10} =0.1 +0.5(0.1 - 0.1)

P_{10} =0.1 +0.5(0)

P_{10} =0.1 +0

P_{10} =0.1

3 0
3 years ago
Which statement about intellectual property is true? (CSI-7.6) Group of answer choices It is okay to use code you find on the in
nika2105 [10]

Answer:

Laws are in place to cover your creative work, which includes code you have written.

Explanation:

Copyright law can be defined as a set of formal rules granted by a government to protect an intellectual property by giving the owner an exclusive right to use while preventing any unauthorized access, use or duplication by others.

A copyright can be defined as an exclusive legal right granted to the owner of a creative work (intellectual property) to perform, print, record, and publish his or her work. Also, the owner is granted the sole right to authorize any other person to use the creative work.

For instance, copyright law which protects the sharing and downloading rights of music is known as the Digital Millennium Copyright Act (DMCA).

An intellectual property can be defined as an intangible and innovative creation of the mind that solely depends on human intellect.

Simply stated, an intellectual property is an intangible creation of the human mind, ideas, thoughts or intelligence. They include intellectual and artistic creations such as name, symbol, literary work, songs, graphic design, computer codes, inventions, etc.

Hence, laws are in place to cover a person's creative work, and it includes code he or she have written.

6 0
3 years ago
Write a Java class with the following methods: getArray(int numStrings) is an instance method that takes command line input (use
mezya [45]

Answer:

Follows are the code to this question:

import java.util.*;//import packae for user-input  

public class Main//defining a class Main

{

public String[] getArray(int numString)//defining a method getArray

{

String[] name=new String[numString];//defining array of String values

Scanner in = new Scanner(System.in);// creating scanner class object for input values from user-end

for(int i=0;i<numString;i++)//defining for loop for input multiple values

{

System.out.print("Enter String Value :");//print message

name[i]=in.nextLine();//input values

}

return name;//return array values

}

public String getLongestString(String[] sArray)//defining a method getLongestString

{

int m=0,mi=0; //defining integer variables

for(int i=0;i<sArray.length;i++)//defining for loop for check the longest value in array

{

if(m<sArray[i].length())//defining if block that checks m varaible value greater then sArray length  

{

m=sArray[i].length();//use m to hold sArray length

mi=i;//use max_index to hold i that is loop value

}

}

return sArray[mi];//return Longest value

}

public static void main(String[] args)//defining main method

{

Main s=new Main();//Creating object of main class    

String[] n;//defining string variable n  

n=s.getArray(5);//use n varaible to call getArray method and store its value

System.out.println("Longest value is: "+s.getLongestString(n));//use print method to call getLongestString method

}

}

Output:

please find attached file.

Explanation:

In the given java program code, inside the main class two method that is "getArray and getLongestString", is defined, in which the "getArray" method uses an integer variable in its parameter and inside the method, an array is defined that use a  scanner class for input array value.

  • In the "getLongestString" pass as a parameter and inside the method, two integer variable "m and mi" is defined that use in the loop to return the longest string value.
  • In the class main method is to define that creates a class object and call the above method and use the print method to return its value.  

4 0
3 years ago
Other questions:
  • What are the advantages of homogenation
    5·1 answer
  • A(n) ____ is a user interface that allows users to interact with graphical objects and pointing devices.
    13·1 answer
  • The most complex part of ssl is the ___________ protocol.
    7·2 answers
  • HELP QUICKLY!!! IF YOUR RIGHT I'LL MARK YOU BRAINLIEST
    15·2 answers
  • Write a method so that the main() code below can be replaced by simpler code that calls method calcMilesTraveled(). Original mai
    11·1 answer
  • The Advanced Properties sheet enables you to add which of the following?
    15·1 answer
  • Excerpt from "How Prepared Are Students for College Level Reading? Applying a Lexile-Based Approach."
    6·1 answer
  • Why don’t the ads on Brainly load anymore
    14·2 answers
  • write ms-dos command to list all the files and folders of EIGHT sub directory of C: drive in ascending order according to file n
    5·1 answer
  • You are making a game! The player tries to shoot an object and can hit or miss it. The player starts with 100 points, with a hit
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!