Set .symmetric_difference() Operation

Sort by

recency

|

320 Discussions

|

  • + 0 comments
    e=int(input())
    n=set(map(int,input().split()))
    f=int(input())
    m=set(map(int,input().split()))
    print(len(n^m))
    
  • [deleted]Challenge Author
    + 0 comments

    For Python3

    e = int(input())
    english = set(input().split())
    f = int(input())
    french = input().split()
    
    print(len(english.symmetric_difference(french)))
    
  • + 0 comments

    input() english_newspaper = set(input().split()) input() french_newspaper = set(input().split())

    print(len(english_newspaper.symmetric_difference(french_newspaper)))

  • + 0 comments

    n = int(input()) A = set(input().split()) b = int(input()) B = set(input().split()) print(len(A^B))

  • + 0 comments

    Here's my code:

    el = int(input())
    e = list(map(int, input().split()))[:el]
    fl = int(input())
    f = list(map(int, input().split()))[:fl]
    print(len(list(set(e).symmetric_difference(f))))