functions functions are useful for breaking up large program to make it easier to read and maintain they are also useful if you find yourself writing the same code at several different points in your program you can put that code in function and call the function whenever you want to execute that code you can also use functions to create your own utilitiesmath functionsetc basics functions are defined with the def statement the statement ends with colonand the code that is part of the function is indented below the def statement here we create simple function that just prints something def print_hello()print'hello'print_hello(print' 'print_hello(hello hellothe first two lines define the function in the last three lines we call the function twice one use for functions is if you are using the same code over and over again in various parts of your programyou can make your program shorter and easier to understand by putting the code in function for instancesuppose for some reason you need to print box of stars like the one below at several points in your program