社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
私信  •  关注

Sayed Hussain Mehdi

Sayed Hussain Mehdi 最近创建的主题
Sayed Hussain Mehdi 最近回复了
5 年前
回复了 Sayed Hussain Mehdi 创建的主题 » 如何在python中基于另一个列表重新排列列表
def intersection(lst1, lst2): 
    lst3 = [value for value in lst1 if value in lst2] 
    return lst3

fixedList = ['116','117','114','99','102','101','95']
unorderedList = ['99','116','117']

print( intersection(fixedList,unorderedList)) 

https://www.geeksforgeeks.org/python-intersection-two-lists/