Using Functions in Python | Learning Python for Beginners | Code with Kylie #7

preview_player
Показать описание
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.

Thanks for watching everyone!
~~~~~~~~~~~~~~~~~~~~~~~~
Рекомендации по теме
Комментарии
Автор

Is coding fun? Lol


Subscribe for more Python tutorials :)
Follow me on insta/twitter: @kylieyying

KylieYYing
Автор

Kylie, thank you. Your content is amazing. Because of you I'm actually starting to enjoy coding, and not only that, you've turned me into a better IS student, and because of that I believe I am going to do extremely well this year. Bless up

freshkever
Автор

after so much struggle with the def function, your explanation just gave me clarity. I will stay glued to your channel, you are awesome

rachaeldrmarketing
Автор

I was stuck in my quest to learn Python. Functions were particularly hard for me but Kylie explained it in such a way that I can move on now. Thank you so much Kylie.

wism
Автор

Thank you for such a very helpful video Kylie! You’re the best, I’ve been leaning coding at school and still struggling about functions, but the ways you taught are really easy to understand, now I understand!

jintathiti
Автор

A natural born teacher. All the scenarios are perfect. Thx

decongh
Автор

I didn't understand loops until I watched ur video.Your video is definitely worth watching.

PeaceElijah-rold
Автор

I love this series !!! <3 Keep up the good work Kylie !

orestas
Автор

I love how easily you explain things! thank you!!

lourdesflores
Автор

Nice u taught me my first game and my first code in pyhton btw i am a 11 year old

unkownnn
Автор

After many videos you finally explain to me the return function. Thank you and stay blessed.

damychristo
Автор

Hey - Appreciate this breakdown. Have a script that I need to convert, and was very much over thinking it. Your breakdown was concise and was able to pick up the concepts with no issues. Thanks so much for sharing!

mathewrtaylor
Автор

Excellent lesson! Thank you so much. You are a great teacher.

teacherinthailan
Автор

Thanks for your videos! I'm currently taking a Intro to Python class and I always look for your videos first! lol

thatDavidMota
Автор

Thank you Kylie! ☺️ this made my module way easier to understand

joelten
Автор

Thank you Kylie I like how you explain code stuff, great work 👍

dzeykop
Автор

Thank you, this was the only video I could find that helped me personally.

christinashumpert
Автор

It was totally wholesome Python course that I 've ever seen. Never failed to entertain us even while explaining important topics and yet it's the best part about you 🙌🏻. Btw, the photo frames were really cute tho 😆

kraftykoder
Автор

I am leaving this comment as a sign of gratitude..You helped me a lot❤️❤️🇧🇩🇧🇩

gmnahin
Автор

lovely series Kylie, keep the good work !!!

mattheusmegdom