For example, I'm going to do a random walk with the Turtle module. I also want a random color for each move.
Should I put all that into one function? Or do I have one function to move the turtle and then another to change the color?
Actually this example isn't too good but I just want to know how programmers decide that a function is neccessary rather than just a loop.