-->
当前位置:首页 > 题库

PROGRAMMING:Merge two lists and remove duplicate

Luz5年前 (2021-05-10)题库465
Input two lists, alist and blist. Each element in the list should be a positive integer and no more than 10;
Merge alist and blist, remove the duplicate elements and output a new list Clist.
You can use the following to implement the input of list alist:
one alist=list(map(int,input().split()))
At the same time, in order to ensure the consistent output results, please sort the elements in the collection before output.
For example, for list alist, sorted (alist) can be output.
Input format:
There are two lines, each of which is used to enter the element values in the list, separated by spaces.
Output format:
A total of one line, printed as a list.
###Input example:
Here is a set of inputs. For example:
```in
1 2 3
4 3 2
```
###Output example:
The corresponding output is given here. For example:
```out
[1, 2, 3, 4]
```







answer:If there is no answer, please comment