list 把某个元素放在第一位

mylist.insert(0, mylist.pop(mylist.index(targetvalue)))
posted @ 2022-03-20 21:37  bH1pJ  阅读(566)  评论(0编辑  收藏  举报