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...


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.


EXAMPLE RUN #1:<br>Input :<br>sequence-1 input: 2 7.3 20.3 99 102.7<br>-1<br>sequence-2 input: 10 20.3 77 -1<br>Output:<br>2 7.3 10 20.3 20.3 77 99 102.7<br>

Extracted text: EXAMPLE RUN #1: Input : sequence-1 input: 2 7.3 20.3 99 102.7 -1 sequence-2 input: 10 20.3 77 -1 Output: 2 7.3 10 20.3 20.3 77 99 102.7
EXAMPLE RUN #3<br>Input :<br>sequence-1 input: 2 -1<br>sequence-2 input: 1 -1<br>Output:<br>1 2<br>

Extracted text: EXAMPLE RUN #3 Input : sequence-1 input: 2 -1 sequence-2 input: 1 -1 Output: 1 2

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here