Python When To Use Nested Functions Mysql W3schools