如何在不停止 FOR 循环的情况下停止 FOR 循环中的 IT 循环

How to stop IT loop in FOR loop without stopping the FOR loop

        for job in jobs:
            if int(dpr) <= int(user.dpr):
                if str(user.gender) == 'male:
                    if str(orpi) == 'yes':
                        if int(profil) >= int(user.profil):
                            bot.send_message(message.chat.id, str(name)
                        **now i want to exit the "if's" and go to next "job in for loop**
                else:
                    if int(profil) <= int(user.profil):
                            bot.send_message(message.chat.id, str(name)
                        **now i want to exit the "if's" and go to next "job in for loop**
            else:
                if str(orpi) == 'yes':
                    if int(profil_fem) >= int(user.profil):
                            bot.send_message(message.chat.id, str(name)
                        **now i want to exit the "if's" and go to next "job in for loop**
                else:
                    if int(profil_fem) >= int(user.profil):
                            bot.send_message(message.chat.id, str(name)
                        **now i want to exit the "if's" and go to next "job in for loop**

你好,我想做“现在我想退出“if's”并转到代码中的下一个“for 循环中的作业”,return 到for循环(job in jobs),并处理到下一个作业。有什么命令吗?

您可以使用 continue 关键字。 它允许您忽略接下来的所有内容并转到循环的开头。 例如在这种情况下:

for i in (0, 1, 2):
   print(i)
   continue
   print("This won't get executed")

continue 之后的行永远不会 运行。