Dealing with Nested Loops in Python - Options?

后端 未结 2 1563
南旧
南旧 2021-01-27 18:49

I have a function that looks like this (below). I\'m using xlrd in python. Whenever I perform the \"print path\" function, I receive way too many iterations of path. Essentially

2条回答
  •  臣服心动
    2021-01-27 19:14

    This seems closer to what want:

    for new in newton:
        for jam, pat in zip(james, path):
            if jam == new:
                print pat
    

提交回复
热议问题