All published worksheets from http://sagenb.org
# Polynomials over the field with 2 elements and variable 'X' R.<X>=GF(2)[]
P=X^2+X^4+X^5+X^8 PP1=P*X; print PP1 PP2=P*(X+1); print PP2
def pol2binary(poly): lst=list(poly) #for x in range(0,len(lst)): # print lst[x] lst.reverse() return lst
pol2binary(PP1)
def interleaving(lst1,lst2): y=0 lst = [] for x in range(0,len(lst1)): lst.append(lst1[x]) lst.append(lst2[y]) if y<=len(lst2): y=y+1 print lst
interleaving(pol2binary(PP1),pol2binary(PP2))