Paraphraser online
#1
inputstr1=input('Enter elements separated by ,(comma) for set1:')
inputstr2=input('Enter elements separated by ,(comma) for set2:')
inputt1=inputstr1.split(',')
inputt2=inputstr2.split(',')
inset1=set(inputt1)
inset2=set(inputt2)
print('Symmetric_difference of set1 and set2:',list(inset1.symmetric_difference(inset2)))
print('set1 ^ set2:',list(inset1^inset2))
inset1.symmetric_difference_update(inset2)
print('Sorted order of set1 after symmetric_difference_update:',sorted(list(inset1)))
print('Sorted order of set2 after symmetric_difference_update:',sorted(list(inset2)))
inputstr3=input('Enter elements separated by ,(comma) for set3:')
inputstr4=input('Enter elements separated by ,(comma) for set4:')
inputt3=inputstr3.split(',')
inputt4=inputstr4.split(',')
inset3=set(inputt3)
inset4=set(inputt4)
inset3^=inset4
print('Sorted order of set3 after (set3 ^= set4):',sorted(list(inset3)))
print('Sorted order of set4 after (set3 ^= set4):’,sorted(list(inset4)))
Weerapol Paengya