Python中zip的所有可能变体 [英] All possible variants of zip in Python

查看:27
本文介绍了Python中zip的所有可能变体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我的代码如下:

a = [1, 2]
b = [4, 5]

我如何得到这样的东西:

How can I get something like this:

[(1,4), (1,5), (2,4), (2,5)]

类似于功能 zip ,但具有所有可能的变体.还是我不能?

Like function zip does, but with all possible variants. Or can't I?

推荐答案

您要 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆