Question: A program, in a file named two_lines_of_words.py , which reads two lines of input from the user. Use split() to break each one into words.

A program, in a file named two_lines_of_words.py , which reads two lines of input from the user. Use split() to break each one into words. Next, print out each of the two arrays of words, along with a little bit of explanatory text (see the example below for details). Then print a blank line. (Remember: To print a blank line, call print() with no arguments; it will print nothing, and then follow it up with a newline.) Next, concatenate the two arrays together, and print out some information about the combined array, followed by another blank line; again, see below for details. Next, sort the combined array, and then print it out, followed by a final blank line. Finally, have a short loop which prints out pairs of values - one from the first array, and one from the second array. End the loop when you hit the end of either of the two arrays.

EXAMPLE: Suppose that the user types the following lines of input:

asdf foobar

10 1 11 111 2 -4

Your program should produce the following output for the pairs part:

Pairs:

0: asdf,10

1: foobar,1

******I need help with the pairs part of the question. I can't seem to figure out how to start that part. (Everything else is done)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!