def _(A='a,3,2,c,1,ф,!,D,p',
S=[sorted(list(el.split(',')))
st=r'<left style=%s>'%'color:%s'
s1=r'$\large{A \cap B = %s}$'
s2=r'$\large{A \cap C = %s}$'
s3=r'$\large{B \cap C = %s}$'
s4=r'$\large{A \cap B \cap C = %s}$'
AB=list(set(S[0])&set(S[1]))
AC=list(set(S[0])&set(S[2]))
BC=list(set(S[1])&set(S[2]))
ABC=list(set(AB)&set(S[2]))
pretty_print(html(st%'#ff3636'+\
s1%('{'+','.join(AB)+'}')))
pretty_print(html(st%'#36ff36'+\
s2%('{'+','.join(AC)+'}')))
pretty_print(html(st%'#3636ff'+\
s3%('{'+','.join(BC)+'}')))
pretty_print(html(st%'#ff36ff'+\
s4%('{'+','.join(ABC)+'}')))
No comments:
Post a Comment