L=[1,0,1,1,0,0,0,0] if L[0]==1: for x in range(1,8): if L[x]==1: L[x]=0 else: L[x]=1 print(L)