我该如何将lst1转换为lst2,通过将元素1与元素2等依次连接起来?
lst1=[' ff 55 00 90 00 92 00 ad 00 c6 00 b7 00 8d 00 98 00 87 00 8a 00 98 00 8f 00 ca 01 78 03 54 05 bf']
lst2=[ff55, 0090, 0092, 00ad, 00c6, 00b7, 008d, 0098, 0087, 008a, 0098, 008f, 00ca, 0178, 0354,05bf]
我尝试了,但效果不如预期:
for i in lst:
lstNew = []
tempList = i.split()
lenList = len(tempList)
#print tempList
index = 0
while (index < lenList):
print tempList[index] + tempList[index+1]
index = index + 2
[a + b for a,b in zip(...)]
:-) - mgilsonlst
的闭合]
。 - Yep_It's_Me