So at a why would I need to use control flow? Don't I already have everything I need to make a program?


#1

Question

So at a why would I need to use control flow? Don’t I already have everything I need to make a program?

Answer

Not necessarily. A majority of applications run based on user input. Control flow can allow you to make decisions based on that user input, or any other conditions you want to give it! An example of when I would use control flow is if I wanted to set energy = 10 if I had coffee this morning and energy = 1 if I didn’t.