聪明hrr 发表于 2021-2-2 16:04:12

学习python的问题

打扰一下,想问问这里切片之后也只有‘3...‘,'4,....'呀,为啥顺序就是对的1234了呢。谢谢{:10_310:}

>>> list3 = for slogan in list1 for name in list2 if slogan == name]

qiuyouzhi 发表于 2021-2-2 16:18:03

https://fishc.com.cn/thread-158908-1-1.html
页: [1]
查看完整版本: 学习python的问题