Breaking out of an if-statement ends the function that contains it.
Solution for How to break out of an if statement in Python : You can use return to break out of an if statement Use return inside of an if-statement to break out of it and end the function.