Functions are pieces of code and they're terrific! You create them to do something specific And functions can have all the stuff we talked about before Like variables, loops, conditions, and more! The best thing about functions is they are designed To be used and reused many many many times! A function is a bunch of code that has a set of steps To complete a specific action And you may not realize it But in a way you complete functions in your own life every day All the time When you brush your teeth Or tie your shoes Or get on the bus To go to school You're completing a set of steps in order to do something specific And that's just like a function! Functions are pieces of code and they're terrific! You create them to do something specific And functions can have all the stuff we talked about before Like variables, loops, conditions, and more! The best thing about functions is they are designed To be used and reused many many many times! So let's create a function together to get our robot friend To roast us a marshmallow! The first thing we need to do is name the function to remind us What it does, so we are going to name this function roastIt! Inside the roastIt function we need to code the steps Which are find a marshmallow Poke the marshmallow through the stick Hold the stick over the fire Wait until the marshmallow is brown but not black Take the stick away from the fire Pull the marshmallow off and voila! We just made a function! Functions are pieces of code and they're terrific! You create them to do something specific And functions can have all the stuff we talked about before Like variables, loops, conditions, and more! The best thing about functions is they are designed To be used and reused many many many times! So let's talk about the best thing about functions They are reusable! Remember all those steps that went into creating the function? Well, the next time you want to roast a marshmallow You don't have to say all steps again You can just call the name of the function! Want another marshmallow right now? Just call roastIt! Want one tomorrow? That's right, just call roastIt! What about in six months? Uh huh, roastIt! And here's another cool thing Functions can be created to be adaptable! You could use the same function with the same steps And bring in other things to roast, like hot dogs! I sure do love functions! Functions are pieces of code and they're terrific! You create them to do something specific And functions can have all the stuff we talked about before Like variables, loops, conditions, and more! The best thing about functions is they are designed To be used and reused many many many times!