Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (21 sloc) 499 Bytes
def pprint(A):
R=list(A)
print "{",
for x in R[:-1]:
print str(x)+",",
print R[-1],
print "}"
f=open("rosalind_seto.txt","rU")
L1=f.readline()
L2=f.readline()
L3=f.readline()
f.close()
A=set(map(int,L2.strip("{}\n").split(",")))
B=set(map(int,L3.strip("{}\n").split(",")))
U=set(range(1,int(L1)+1))
pprint(A.union(B))
pprint(A.intersection(B))
pprint(A.difference(B))
pprint(B.difference(A))
pprint(U.difference(A))
pprint(U.difference(B))
You can’t perform that action at this time.