如何在python中打印嵌套列表的所有可能性?

如何在python中打印嵌套列表的所有可能性?,第1张

如何在python中打印嵌套列表的所有可能性

我认为

itertools.product()
实际上 您要寻找的东西:

pos = [['det'], ['noun', 'adj'], ['noun'],       ['vb'], ['det'], ['vb', 'noun', 'adj']]for x in itertools.product(*pos):    print " ".join(x)

版画

det noun noun vb det vbdet noun noun vb det noundet noun noun vb det adjdet adj noun vb det vbdet adj noun vb det noundet adj noun vb det adj


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5664331.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存