and easier to maintain before fixing up the future value programlet' take look at what functions have to offer functionsinformally you can think of function as subprogram-- small program inside of program the basic idea of function is that we write sequence of statements and give that sequence name the instructions can then be executed at any point in the program by referring to the function name the part of the program that creates function is called function definition when function is subsequently used in programwe say that the definition is called or invoked single function definition may be called at many different points of program let' take concrete example suppose you want to write program that prints out the lyrics to the "happy birthdaysong the standard lyrics look like this happy birthday to youhappy birthday to youhappy birthdaydear happy birthday to youwe're going to play with this example in the interactive python environment you might want to fire up python and try some of this out yourself simple approach to this problem is to use four print statements here' an interactive session that creates program for singing "happy birthdayto fred def main()print("happy birthday to you!"print("happy birthday to you!"print("happy birthdaydear fred "print("happy birthday to you!"we can then run this program to get our lyrics main(happy birthday to youhappy birthday to youhappy birthdaydear fred happy birthday to youobviouslythere is some duplicated code in this program for such simple programthat' not big dealbut even here it' bit annoying to keep retyping the same line let' introduce function that prints the lyrics of the firstsecondand fourth lines def happy()print("happy birthday to you!"