Day 6: Learn about Functions
Today I focused on functions. I learned that a function is a set of commands that perform a specific task, and can be called at any time during a program. The benefit of functions is that they make code more organized and less repetitive. I wrote my first function that calculates the sum of numbers, which was a fun experience because it made me feel like I could write more complex code.
I also discovered that functions can take parameters and return outputs, which made me understand how I can build more interactive programs. For example, I can build a function that takes a user’s name and greets them with a custom message.
Comments
Post a Comment