callind def with another def in if-else statement

im a newbie here in python and in this forum site. im using python 2.7.1. and im making a simple calculator that can trap if the second input is zero in division 0peration..
is it possible to call def to def within the if-else statement where ?? because im trying to show an another tkinter with label that shows that it is an error in division operation..

It is legal to define local functions that are effectively invisible outside the outer function. But I doubt that is what you mean? I think you are trying to say something about program flow. To "trap" an illegal division, I would raise an exception, and handle it in the main loop: