python列表作业
1. input two lists :alist and blist,members of each list are of integer decimals and no more than 10;
merge alist and blist as a new list clist, in which duplicate elements are eliminated。
A list can be inputted as follows:
alist=list(map(int,input().split()))
to ensure the output is consistent, please output the elements of the new list in sequence,which can be accomplished as sorted(alist)。
Input format:
Two lines are typed, each line is used to input a list, list members are separated by space。
Output format:
One line is outputted as list。
Input example:
1 2 3
4 3 2
Output example:
[1,2,3,4]
#两行变一行,加去重
alist=list(map(int,input().split()))
blist=list(map(int,input().split()))
print(sorted(list(set(alist+blist))))
没有把输入限制在10以内,不