我正在寻找解决方案。目前,我有两个元素列表:
column_width = ["3", "3", "6", "8", "4", "4", "4", "4"]
fade = ["100", "200", "300"]
Run Code Online (Sandbox Code Playgroud)
我想要实现的是创建for循环,它将为我提供以下输出:
column-3-fade-100
column-3-fade-200
column-6-fade-300
column-8-fade-100
column-4-fade-200
...
Run Code Online (Sandbox Code Playgroud)
嵌套for循环对我不起作用:
for i in fade:
for c in column_width_a:
print("column-{0}-fade-{1}".format(c, i))
Run Code Online (Sandbox Code Playgroud)
还有其他产生此输出的方法吗?