我有两张单子
list_a = ['an378j', 'an378jijm', 'fg453h', 'fg453hbrd']
list_b = ['fg453h2564677sakjh', 'an378jijm564456464ewf', 'fg453hbrd8968764ewf', 'an378j86764edwf']
注意:列表list_a
的前几个字符与列表list_b
的前几个字符相同。你知道吗
我需要根据序列重新排列Listlist_b
,匹配的字符放在Listlist_a
。你知道吗
所以新的清单应该是:
['an378j86764edwf', 'an378jijm564456464ewf', 'fg453h2564677sakjh', 'fg453hbrd8968764ewf']
很冗长,但它做你想做的。你知道吗
我的解决方案:
对于不同的输入:
相关问题 更多 >
编程相关推荐