Wenn die Antwort die Bedingung befriedigte, wie man sie aufhört, in Python weiter voranzukommen

if the answer satisfies the condition so how to stop it to run further ahead in python
Anxious Ant