Question: IN PYTHON Develop the program that will allow you to obtain an ordered list of whole numbers from least to greatest from two lists of

IN PYTHON Develop the program that will allow you to obtain an ordered list of whole numbers from least to greatest from two lists of whole numbers. The individual values of the input lists are captured by the user one by one and then both lists will be joined and then sorted in ascending order (from lowest to highest value). Your program should allow the capture of the entire values of the lists without making use of messages (legends) to the user and will show the result in the form indicated below
To order: You cannot use the sort or sorted function or any function already ordered. You will have to write it yourself. If you use any of these functions you will not have extra points. I recommend you make a function called order (list) that receives a list and returns an ordered list. The algorithm to sort would be more or less like this:
For each item in the list, one pass to the list will be made On each pass, the element i will be checked with the i + 1 and if the element in i is larger than the element that is in i + 1, exchange them, continue checking until one before the end (so that in i + 1 you don't an index out of range comes out, in this way, the larger number will be 'pushed' to the end and it is not necessary to revise that element (your range may decrease each pass). If there were no exchanges, it means that everything is already in order and it is not necessary to make more passes (you can use a Boolean variable to know if you made an exchange or not)

example:

3 1 4 5 * 2 9 6 1 3 *

OUTPUT

L1 = [3, 1, 4, 5] L2 = [2, 9, 6, 1, 3] LORDENADA = [1, 1, 2, 3, 3, 4, 5, 6, 9]

Example 2

* *

output

L1 = [] L2 = [] LORDENADA = []

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 Databases Questions!