Using Functions in Python | Learning Python for Beginners | Code with Kylie #7
Kylie Ying Kylie Ying
64.5K subscribers
59,535 views
0

 Published On Aug 17, 2020

Functions are like boxes of little squirrels that take in data and do something and potentially spit out new data!

No, seriously.

In this video, I go over how to define and call a function in python. I go over the syntax necessary to define a function, and then how to run the function. I also talk about how to add parameters in the functions and then how to pass data into the function as arguments when you call it!

Parameters are the variables that you define the function with and arguments are the values that you pass into the function when you call it!

Finally, I go over how to actually return data from the function. I know many beginners typically get confused when it comes to print vs return in a function. So, I go over this difference in the video too. Hope this helps!

Functions are great for many reasons! They allow you to create your self-contained code isolated from the rest of the script, letting you break down your code into more digestible pieces! Also, when you want to reuse the same code multiple times in a script, you can wrap it in a function instead of copy and pasting! This makes editing bugs in your code easier since you don't have to find all those various places the code was pasted. You edit in one location and you're done!

#LearnToCode #PythonForBeginners

Feel free to leave any questions.

Please consider subscribing if you liked this video: https://www.youtube.com/c/ycubed?sub_...

Thanks for watching everyone!
~~~~~~~~~~~~~~~~~~~~~~~~
Follow me on Instagram:   / kylieyying  
Follow me on Twitter:   / kylieyying  
Check out my website: https://www.kylieying.com

show more

Share/Embed