ho:Come per aggiungere più elementi in una sola riga in Python
count = 0
i = 0
while count < len(mylist):
if mylist[i + 1] == mylist[i + 13] and mylist[i + 2] == mylist[i + 14]:
print mylist[i + 1], mylist[i + 2]
newlist.append(mylist[i + 1])
newlist.append(mylist[i + 2])
newlist.append(mylist[i + 7])
newlist.append(mylist[i + 8])
newlist.append(mylist[i + 9])
newlist.append(mylist[i + 10])
newlist.append(mylist[i + 13])
newlist.append(mylist[i + 14])
newlist.append(mylist[i + 19])
newlist.append(mylist[i + 20])
newlist.append(mylist[i + 21])
newlist.append(mylist[i + 22])
count = count + 1
i = i + 12
ho voluto fare le dichiarazioni in newlist.append()
alcune affermazioni.
Beh, ovviamente, non è lo stesso se si ottengono risultati diversi. – JJJ
Questa è una sintassi non valida. – TerryA
Supponendo che gli oggetti siano intesi come liste, il tuo codice non è Python valido dato che stai usando '[]' invece di '()'. Si prega di inviare codice di lavoro reale. – BrenBarn