Set .union() Operation

  • + 0 comments

    I am giving explanation to my code. First I have used n=int(input()) => for the number of students are in the english news paper and then I am setting this to the set method which is a= set(input().split()) as the numbers need to be split and I am repeating the same procedure for french paper. Later, we need to do the union method and print the length. n = int(input()) n= set(input().split()) b = int(input()) e= set(input().split()) r = n.union(e) print(len(r))