这个Python脚本可以改进吗?
发布时间:2020-12-16 22:11:58 所属栏目:Python 来源:网络整理
导读:这个Python代码可以改进吗? def build_list(types): for x in types: for a in ['short','long','average']: for b in ['square','sloped','average']: for c in ['small','large','average']: for d in ['thin','thick','average']: for e in ['high','low
这个Python代码可以改进吗?
最佳答案
是.你可以使用
itertools.product()
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |