我想知道如何自动化我的嵌套以循环
我想知道如何使嵌套循环自动化: 例如,如果x = 2,我将拥有:
for i in project['tasks']:
for j in i['tasks']:
whatever...
如果x = 3,我将拥有:
for i in project['tasks']:
for j in i['tasks']:
for m in j['tasks']:
whatever...
等...请自动化这个! 提前致谢。
I would like to know how can I automate my nested for loops :
for example if x = 2, i'll have this :
for i in project['tasks']:
for j in i['tasks']:
whatever...
if x = 3, i'll have this :
for i in project['tasks']:
for j in i['tasks']:
for m in j['tasks']:
whatever...
etc... how can automate this please !
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许您可以使用递归电话,类似的话:
Maybe you could use recursive call, something like this: