PYTHON, write a code that allows the user to input two non-negative number sequences in increasing order (the numbers entered are always getting bigger, and no number repeats), both terminated by a -1. The size of each sequence can vary. The output of this code should be a third sequence that is a combination of both sequences 1 and 2 and is sorted in non-decreasing order. Note: Non-decreasing order means there can be a repeated number in the third sequence (see example 1). A strictly increasing order
In PYTHON, write a code that allows the user to input two non-negative number sequences in increasing order (the numbers entered are always getting bigger, and no number repeats), both terminated by a -1. The size of each sequence can vary.
The output of this code should be a third sequence that is a combination of both sequences 1 and 2 and is sorted in non-decreasing order.
Note: Non-decreasing order means there can be a repeated number in the third sequence (see example 1). A strictly increasing order sequence cannot have repeat numbers at all (see example 3).
PLEASE do this using PYTHON, ONLY using while loops. NO language of "break", "len" or "True" please.
Hint: we can use three separate lists to solve this code.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps