Python Functions | Python Tutorial for Absolute Beginners #1
Learn all about Python functions, *args, **kwargs with this Python tutorial for beginners.
🔥Complete Python course for beginners: • Python Tutorial - Pyth...
🔥Subscribe for more videos like this: goo.gl/6PYaGF
Functions are one of the fundamental building blocks of Python and most programming languages that have ever existed. In this tutorial, you'll learn everything you need to know about functions in Python.
You'll learn all about creating and calling functions, as well as working with parameters, arguments, keyword arguments, default arguments, and much, much more.
This is one of the many Python tutorials for beginners I've added to my channel.
Python Exercises for Beginners:
programmingwithmosh.com/pytho...
Python Cheat Sheet:
programmingwithmosh.com/pytho...
Want to learn more from me? Check out my blog and courses:
programmingwithmosh.com
/ programmingwithmosh
/ moshhamedani
I waisted my money by tacking various courses now I realise on youtube its free...
I am intermediate to the programming, I want to learn python for data science and also I want to make career into the field of AI, Thanks for tutorials...
Tutorials on KZhead are "free" because generous people uploads the content, in which they invested time and passion.
@@faustobrusamolino6345 yea thank Jesus for that too I did it on the Python3IDE it went very well till the last one other than that it was very good I’m looking to go very far in Python
You have wasted on your English classes aswell
@@preethamsshaiva2212 fr
def appreciation(name): return name word = “Thankyou very much “ print(word + appreciation(Mosh))
print(word + ' Mosh') and you get the same result quikly, you don't understand why we use function
@@noemirignanese635 hahahahahaha
where are the quotes in Mosh
@@thecrypticmelon its a string
nice dude, i love reading comments
4:50 Types of functions 8:51 Key words argument 10:56 Default arguments 12:30 args 16:48 args** 19:09 Scope 24:21 Exercise
,,🤗
Thanks mate
Thank you, it was very helpful
Plz someone tell me error?: def geto(first,sec): return ("Hello",first,sec) message=geto("Baapo"," & maiya") file=open("content.txt",'w') file.write(message)
@@saraswatiyadav1881Hello Dear .I have Just read your comment posted 2 years ago. Please let me know, where are you right Now as you have Watched this tutorial 2 years ago and I'm taking it today 27 February 2024
OMG bro, I'm 'bout to cry 3 minutes in...I've been struggling with trying to understand the difference between parameters and arguments.. Shhphew!! Thanks, so much for knowledge sharing your skills!!
Dude, that's exactly what I thought. I've been struggling for days!!!
For the benefit of everyone struggling with understanding the basic difference between parameters and arguments, parameters are the comma separated placeholders (CSPHs) that appear in the function declaration, the first line of a function. Arguments are comma separated values, and they appear in the function call. The relationship between parameters and arguments is that arguments and mapped to parameters. So depending on " which side of the line you're on", the term used varies.
@@MrDjRayner this is not quite right, the function call and function declaration both have parameters, we call them formal parameters in the function declaration and actual parameters in the function call. Honestly this is just pedantic and not vital to understanding the code.
@@alvarocajina87 Hello Dear .I have Just read your comment posted 2 years ago. Please let me know, where are you right Now as you have Watched this tutorial 2 years ago and I'm taking it today 27 February 2024
@@MrDjRaynerHello Dear .I have Just read your comment posted 2 years ago. Please let me know, where are you right Now as you have Watched this tutorial 2 years ago and I'm taking it today 27 February 2024
im not even in high school yet, and i already know most of Python because of you! Keep up the good work :')
@shiva swaroop P.S Learn C++ C# then make something big, that the difference between an engineer and a kid, and between electrician and electrical engineer
That's awesome! Me too! :)))
@shiva swaroop P.S learning the syntax is differs from solving complicated problems and developing algorithms
Could I use Arduino devices as a kid too
Thanks for taking the time to create these videos, it's really helping me in my course. You've got a great teaching style and the content is great. Cheers.
Hello Dear .I have Just read your comment posted 2 years ago. Please let me know, where are you right Now as you have Watched this tutorial 2 years ago and I'm taking it today 27 February 2024
thanks Mosh! I've being struggling with def and return function even after watching several youtube tutorial. No one could explain the details as clearly as you did.
It is a wonderful introduction to functions in Python, thank you very much!
When it comes to teaching newbies skills on web development, and other tech stuff, bro, you win!!! Thank you for this. Your voice makes it even sweeter!!
Thank you very much for the quick and good explanation! 💛
Thank you so much Mosh! You're the best teacher out there. Wish you could also make a tutorial on classes and objects!🙏
This was fantastic! I love how you simplify concepts and then build up to more complicated applications. You picked up a subscriber.
iuijp;
Hello Dear .I have Just read your comment posted 2 years ago. Please let me know, where are you right Now as you have Watched this tutorial 2 years ago and I'm taking it today 27 February 2024
i was looking for a perfect lecture on function for many month,,finlay i got it,,and i will continue your lecture,,,and this is my 1st comment in my 10 years of using youtube ,,thank you
Been on functions for a month. You filled my gaps in 20 mins. ❤❤❤
Your videos are so helpful and precise. Can you please do a series on Tensorflow and machine learning? I am highly looking for a quality series on this topic.
That was great Mosh , thank you.
I wasn't expecting this I have never seen a tutorial than explained me so well what I needed to know in my whole life, maybe it's also due to you tackling exactly the doubts I had but never have I seen a single youtube video with such information. The first 5 minutes alone helped me more than hours of python classes, an immediate subscription on my part, keep going man!
I love you mosh ! Been trying to search for tutorials. And I got hold of your content a couple months ago. I also watched the full python course for beginner's video. Just wanted to say thank you! And we can all agree that you are a good teacher.
🧐🧐😏🤨
Hello Dear .I have Just read your comment posted 2 years ago. Please let me know, where are you right Now as you have Watched this tutorial 2 years ago and I'm taking it today 27 February 2024
I'm kinda proud of myself for almost solving the fizz_buzz problem. I just couldn't finish my solution, I did the same thing that you did tho, and I'm a relatively new beginner coming from C++.
Thank you so much, Mosh! You are the best!
the formatting extension for VS Code he mentioned was Autopep 8 for anyone who didn't catch it. I went to the transcript to understand what he said. I'm so excited to not have to have to google all my formatting questions! Also solid explanations, thanks Mosh!
Thank you for this video. Really helpful!!
Thanks Mosh, this is just awesome
if what you said is true about the exercice fizzbuzz being tricky, you just made the very tiny confidence I have in python raised a bit! thanks for that!
THANK YOU VERY MUCH well explained
Thanks so much for taking your time and creating this fantastic video.
this is so cool mosh! thank you!
This helped me for my college class thank you!
I love how you called out using the global keyword in functions as bad practice. Your teaching/coding style is clean and minimalist, that's why we're all here!
Hello Dear .I have Just read your comment posted 3 years ago. Please let me know, where are you right Now as you have Watched this tutorial 3 years ago and I'm taking it today 27 February 2024
INDEED, you are a GENIOUS, Mosh. Lots of knowledge, Perfection in teaching, amazing videos. Thanks. I think I'll learn a lot with you.
Hi Mosh. Thank you for your fantastic videos. You certainly were born to teach. You make the material so easy to understand. I am glad I found your channel.
You're very clear in the explaination, thanks a lot
It's your trademark to represent and explain the things in a clear concise and exact manner !! This makes learning material comprehensible easy to digest and remember. Without the burden of excessive words. Thank you very much i appreciate this !!!
Hello Dear .I have Just read your comment posted 5 years ago. Please let me know, where are you right Now as you have Watched this tutorial 5 years ago and I'm taking it today 27 February 2024
Amazing tutorial, thank you so much for sharing.. This is one of the clearest tutorials on functions, I'm learning heaps
kzhead.info/sun/pa59gcl7i4N6has/bejne.html&t=
Hello Dear .I have Just read your comment posted 4 years ago. Please let me know, where are you right Now as you have Watched this tutorial 4 years ago and I'm taking it today 27 February 2024
Thank you, After a huge struggle, you helped me to clear my doubts of parameters and arguments.!!!! Thank you Sir !!!!!!!!!!!!! I will keep watching your channel... :)
Short and Sweet. Keep on making some cool tutorials. I enjoyed a lot .
Your videos are so good that viewers even forget to like the video and jump to watch more of your content. Guys please like these brilliant lectures after watching it.
men you saved my life thank you so much for this tutorial!!! greetings from Mexico
this helped me tremendously for my intro to python programming course I'm taking. I will return to your page again. Thanks.
30 mins just awesome learning. Thank you!
Hello Dear .I have Just read your comment posted 2 years ago. Please let me know, where are you right Now as you have Watched this tutorial 2 years ago and I'm taking it today 27 February 2024
@@Believer758 hes dead
@@user-eh8be5zk8u Okay 🥲
Great content I was stock on this, now se everything clear thanks to you brother god bless you
Hello Dear .I have Just read your comment posted 2 years ago. Please let me know, where are you right Now as you have Watched this tutorial 2 years ago and I'm taking it today 27 February 2024
I've started with C++ and used a few other languages, mostly static. Now that I'm learning python I'm having a hard time with those indentations :D they look and feel so unnatural Great tutorial as always, love that there is a variety!
me too! it feels to simple. i'm not used to not having a thousand of errors because of an extra bracket...
@@snatamohanty6612 haha yeah, like 'SOMETHING IS WRONG SINCE NOTHING IS WRONG' :D Indentation errors (or not necessarily even errors, but the wrong indentation) caused me little confusion though
@@kitcat2449 no because same. now whenever I get an error I just give up and shut down my whole computer, I am not patient at all lmao
@@snatamohanty6612 taking breaks is good for your brain at least lol. I have the exact opposite problem, I tend to obsessively focus so I forget to eat and take bathroom breaks 🗿
His multiply function reminded me of a recent security vulnerability. Anything * 0 = 0. While it was fine his function didn't check for a 0 being passed that isn't always the case. In a real world scenario someone figured out there was no check for a public key being a 0. As a result the hacker could pass a zero and bypass security because multiplication is used to verify keys.
Hello Dear .I have Just read your comment posted 1 year ago. Please let me know, where are you right Now as you have Watched this tutorial 1 year ago and I'm taking it today 27 February 2024
@@Believer758 I don't use Python daily and I was simply refreshing my knowledge on functions in Python. I'm sure you will do well as Python is one of the easier languages compared to something like C.
Easy to understand by beginners too.. Thanks
Very concise and useful, thank you
many thanks, really helpful
thank you Mosh it was Wonderful .
Thanks so much! You explain better than my teacher!
Thank you this video, really helpful!!
What is your theme for VS Code? It’s so clean. The line turns red under the open tab instead of the text. It's very well made. Your icons are smooth as well.
Great Teaching style and method and presentation !
GREAT video! Thank you so much!
#You take your time in teaching✅ # You are audible ❤ # and prepares very well for each class💯. THUMB UP 👍
My name is Denis Kimutai. I am a beginner in software engineering. Have never watched a clear and understudble tutorial like yours. The progress I make everyday in my software engineering cannot even be explained more than saying thank you sir. African normally struggle with the whites English. But you speech is clear and understudble.. Thank you sir and God bless you.
Thank you for this amazing tutorial!!!!
fajn coode is on kzhead.info/sun/drGcdduXfoZuZZ8/bejne.html
Hi Mosh I’m very much interested with the theme that you use on vscode, Can you put the name of the theme on the description please Thanks
Thanks Mosh! It was very easy to understand.
Excellent teaching skills and knowledge great job !!
Thank you so much for this videos they are perfect and free. 🎉
Very in depth and concise
I did the excersize. i am currently 13 and had a hard time learning to program. that is probably because i am quite dumb. but with your videos its been so much easier. thank you. i am planning to buy the course today.
Sir you are not quite dumb. I know I don't know you but what I do know is you are totally smarter than most 13 year old's. You are learning to program at 13, I'm 46 and just learning to code myself. So never say such things about yourself. You sound like an awesome, smart 13 yr old. God Bless.
@@JCASAS40 Thank you. Good luck with your coding :)
fajn coode is on kzhead.info/sun/drGcdduXfoZuZZ8/bejne.html
all video tutorials are premium and professional ! thank you very much for sharing them to us !
Great Lesson, I was able to learn a lot about Functions
you are great sir!
Am in kenya,,,mosh thank you,,I love the way of your teaching,,I will stick on your teaching until I know programming
Great explanation, Mosh. Thanks a lot
Learnt an invaluable lesson from the "Exercise" part of the tutorial: Always test & retest your code!
3:21 @mosh my C program textbook says arguments that are passed in a function called actual argument/ actual parameter. On the other hand inputs to function calls formal argument/formal parameter. Can I use these terms in Python also? Or these term is language specific?
Thanks for the lesson! I didn't know you could use AND to check multiple conditions for IF. I was able to accomplish this with a nested IF instead. Then I tried zero as an argument... Feature or Bug? I guess we need to add IF INPUT == 0, RETURN INPUT to the top of our function, ehh? def fizz_buzz(input): if input == 0: return input if input % 3 == 0: if input % 5 == 0: return "FizzBuzz" return "Fizz" if input % 5 == 0: return "Buzz" return input
I learnt parameters nd argument clearly thank you.
I love how you teach Mosh.
By far, one of the best.
Thank you so much. You are one of my favorite teacher for Python.
Excellent education - thanks
Your an excellent teacher. Thank you
I paused to do the fizz_buzz project. I did the calc old-school though. if x/3 == int(x/3): I have to remember the % option. I added a while loop at the end for testing so it would loop until I pressed 0. lol. Good exercise! I was talking to the screen when the if for 3 and 5 was at the end saying it will never make it. lol then of course you fixed it. I didn't like that you used (input) though in the example as that was confusing as there is an input() function and this was not related that. I was thinking I missed something. Love the videos. Very easy to follow and useful info. Liked&Subscribed!
wow, what a great video..made functions easier to understand
Please go to this link and subscribe if you LIKE watching Coding videos. (NOTE- Subscribe only if you ❤ programming) Link-kzhead.info/tools/9n1st3cSVeu3sQpbRbyEyQ.html
I found this video very useful. Thank you!!!
Hi Mosh please make tutorial on spring boot and especially spring security .It will be very useful for lots of people , especially of you are doing :)
Hi Mosh, You are awesome to teach.
OMG!!! Wow! I meaned all The! You're Really a Great Coder! and You're More Intelligent then Harry! Thank you so much Other Peoples Provides Just Full course but not means about it!
You're the best dude 🙏
Very well explained. Thank you
Thanks for this video, I really appreciate it
Life Saver!
This is awesome lessons
awesome video ! Its really helped me a lot. i can say ur playlist is the best in youtube for python. If u can manage time please upload some projects in python like snake game or a calculator. And i also requesting u to make a video on how much useful python is for competitive programming problem solving.
hey hows ur python progress?:)
Great teacher. Thank you so much for sharing this.
man thank you so much for that!!
Great video it was quite helpful
Thank you this made the unclear parts of my course much clearer
This video is gold. Thanks
This is a great video!
That's was really good Mosh Big thank you.
i learned more in the first ten minutes of this video than i did while doing another online course. thank you
Hello Mosh, I am beginner in python, checked lot of links for python but your channel finished my search. you are doing great job, Thanks for that.Can you share name of IDE you use, as it throws error exactly.
This IDE is visual studio code 👆
Superb... I love coding with Mosh...❤❤❤
this is my solution, i'm a newbie though. def fizz_buzz(input): if input % 3 == 0 and input % 5 == 0: print("FizzBuzz") elif input % 5 == 0: print("Buzz") elif input % 3 == 0: print("Fizz") else: print(input) print(fizz_buzz(15))
thank you so much