Python Functions | Python Tutorial for Absolute Beginners #1

  Рет қаралды 908,793

Programming with Mosh

Programming with Mosh

Күн бұрын

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

Пікірлер: 421
@terrancekayton007
@terrancekayton007 3 жыл бұрын
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!!
@alvarocajina87
@alvarocajina87 3 жыл бұрын
Dude, that's exactly what I thought. I've been struggling for days!!!
@MrDjRayner
@MrDjRayner 3 жыл бұрын
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.
@bryan0x05
@bryan0x05 2 жыл бұрын
@@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.
@Believer758
@Believer758 3 ай бұрын
​@@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
@Believer758
@Believer758 3 ай бұрын
​@@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
@owilhm
@owilhm 3 жыл бұрын
def appreciation(name): return name word = “Thankyou very much “ print(word + appreciation(Mosh))
@noemirignanese635
@noemirignanese635 2 жыл бұрын
print(word + ' Mosh') and you get the same result quikly, you don't understand why we use function
@DeArtTerminator
@DeArtTerminator 2 жыл бұрын
@@noemirignanese635 hahahahahaha
@thecrypticmelon
@thecrypticmelon 2 жыл бұрын
where are the quotes in Mosh
@truepvp5463
@truepvp5463 2 жыл бұрын
@@thecrypticmelon its a string
@lambachurro8790
@lambachurro8790 2 жыл бұрын
nice dude, i love reading comments
@avinashnadkar9197
@avinashnadkar9197 5 жыл бұрын
I waisted my money by tacking various courses now I realise on youtube its free...
@avinashnadkar9197
@avinashnadkar9197 5 жыл бұрын
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...
@faustobrusamolino6345
@faustobrusamolino6345 4 жыл бұрын
Tutorials on KZfaq are "free" because generous people uploads the content, in which they invested time and passion.
@son_of_hiskingdom5092
@son_of_hiskingdom5092 2 жыл бұрын
@@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
@preethamsshaiva2212
@preethamsshaiva2212 2 жыл бұрын
You have wasted on your English classes aswell
@ayferno7337
@ayferno7337 2 жыл бұрын
@@preethamsshaiva2212 fr
@mty1966
@mty1966 2 жыл бұрын
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
@saraswatiyadav1881
@saraswatiyadav1881 2 жыл бұрын
,,🤗
@ahamedsha9348
@ahamedsha9348 2 жыл бұрын
Thanks mate
@kingofgaming1295
@kingofgaming1295 2 жыл бұрын
Thank you, it was very helpful
@ahmadrandhawa238
@ahmadrandhawa238 Жыл бұрын
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)
@Believer758
@Believer758 3 ай бұрын
​@@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
@SheldonYegon
@SheldonYegon 11 ай бұрын
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!!
@familyguy_random
@familyguy_random Жыл бұрын
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
@AndrewClark83
@AndrewClark83 4 жыл бұрын
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.
@Believer758
@Believer758 3 ай бұрын
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
@CarlFritz24
@CarlFritz24 Жыл бұрын
INDEED, you are a GENIOUS, Mosh. Lots of knowledge, Perfection in teaching, amazing videos. Thanks. I think I'll learn a lot with you.
@wilsonliu1716
@wilsonliu1716 Ай бұрын
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.
@danielnikolov6482
@danielnikolov6482 3 ай бұрын
Been on functions for a month. You filled my gaps in 20 mins. ❤❤❤
@TheGoktas17
@TheGoktas17 2 жыл бұрын
It is a wonderful introduction to functions in Python, thank you very much!
@kostiantynkarzhanov9216
@kostiantynkarzhanov9216 Жыл бұрын
Thank you very much for the quick and good explanation! 💛
@edenrenee7392
@edenrenee7392 3 жыл бұрын
This helped me for my college class thank you!
@markmilan57
@markmilan57 10 ай бұрын
Short and Sweet. Keep on making some cool tutorials. I enjoyed a lot .
@mansoorahmed9455
@mansoorahmed9455 7 ай бұрын
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.
@fartiamfarttt2631
@fartiamfarttt2631 9 ай бұрын
Thanks so much! You explain better than my teacher!
@Sherlock24jp
@Sherlock24jp 3 жыл бұрын
men you saved my life thank you so much for this tutorial!!! greetings from Mexico
@hqbib8083
@hqbib8083 3 жыл бұрын
im not even in high school yet, and i already know most of Python because of you! Keep up the good work :')
@justasydefix6251
@justasydefix6251 3 жыл бұрын
@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
@codingwithkenny6492
@codingwithkenny6492 2 жыл бұрын
That's awesome! Me too! :)))
@protrader8426
@protrader8426 2 жыл бұрын
@shiva swaroop P.S learning the syntax is differs from solving complicated problems and developing algorithms
@skloit_dev3089
@skloit_dev3089 2 жыл бұрын
Could I use Arduino devices as a kid too
@bemccune7671
@bemccune7671 2 ай бұрын
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!
@moliendo102
@moliendo102 5 жыл бұрын
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 !!!
@Believer758
@Believer758 3 ай бұрын
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
@AnnieCushing
@AnnieCushing 2 жыл бұрын
This was fantastic! I love how you simplify concepts and then build up to more complicated applications. You picked up a subscriber.
@Ushq_QgA
@Ushq_QgA Жыл бұрын
iuijp;
@Believer758
@Believer758 3 ай бұрын
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
@taneemalam1135
@taneemalam1135 3 жыл бұрын
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.
@Ushq_QgA
@Ushq_QgA Жыл бұрын
🧐🧐😏🤨
@Believer758
@Believer758 3 ай бұрын
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
@nelsondelarosa5490
@nelsondelarosa5490 9 ай бұрын
Thanks so much for taking your time and creating this fantastic video.
@dabigweav
@dabigweav Жыл бұрын
this helped me tremendously for my intro to python programming course I'm taking. I will return to your page again. Thanks.
@Funky_Hernandez
@Funky_Hernandez 16 күн бұрын
Thank you so much Mosh! You're the best teacher out there. Wish you could also make a tutorial on classes and objects!🙏
@theundeadforever3300
@theundeadforever3300 2 жыл бұрын
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++.
@CSCrew
@CSCrew 3 жыл бұрын
Thank you so much, Mosh! You are the best!
@faustobrusamolino6345
@faustobrusamolino6345 4 жыл бұрын
Amazing tutorial, thank you so much for sharing.. This is one of the clearest tutorials on functions, I'm learning heaps
@DimopoulosInformaticsTutorials
@DimopoulosInformaticsTutorials 4 жыл бұрын
kzfaq.info/get/bejne/qLB0hMh0ubeogqc.html&t=
@Believer758
@Believer758 3 ай бұрын
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
@Trincanacos.
@Trincanacos. Жыл бұрын
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!
@ecodersofficial
@ecodersofficial 2 жыл бұрын
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!
@sandraoriji8351
@sandraoriji8351 4 жыл бұрын
Thanks Mosh, this is just awesome
@amandal8404
@amandal8404 3 жыл бұрын
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!
@Believer758
@Believer758 3 ай бұрын
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
@spaulpaul3242
@spaulpaul3242 2 жыл бұрын
Am in kenya,,,mosh thank you,,I love the way of your teaching,,I will stick on your teaching until I know programming
@nilusah4356
@nilusah4356 3 жыл бұрын
Thank you for this video. Really helpful!!
@sn66410
@sn66410 2 жыл бұрын
30 mins just awesome learning. Thank you!
@Believer758
@Believer758 3 ай бұрын
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
@user-eh8be5zk8u
@user-eh8be5zk8u 20 күн бұрын
@@Believer758 hes dead
@Believer758
@Believer758 20 күн бұрын
@@user-eh8be5zk8u Okay 🥲
@francismannion7075
@francismannion7075 4 жыл бұрын
That was great Mosh , thank you.
@jakesnell7707
@jakesnell7707 3 жыл бұрын
this is so cool mosh! thank you!
@DenzelTheSecond
@DenzelTheSecond Жыл бұрын
Very concise and useful, thank you
@karasanteswebtv
@karasanteswebtv Жыл бұрын
Great Teaching style and method and presentation !
@juaninfante7000
@juaninfante7000 4 жыл бұрын
Great content I was stock on this, now se everything clear thanks to you brother god bless you
@Believer758
@Believer758 3 ай бұрын
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
@deniskimutai9563
@deniskimutai9563 Жыл бұрын
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.
@Pravinamadoori
@Pravinamadoori 3 жыл бұрын
Easy to understand by beginners too.. Thanks
@tonytony-fc6gq
@tonytony-fc6gq 5 жыл бұрын
THANK YOU VERY MUCH well explained
@emmanueloseitutu7376
@emmanueloseitutu7376 Жыл бұрын
By far, one of the best.
@marcosknez4024
@marcosknez4024 Жыл бұрын
GREAT video! Thank you so much!
@derickmusinguzi
@derickmusinguzi 8 ай бұрын
Great Lesson, I was able to learn a lot about Functions
@TheMasudsaedi
@TheMasudsaedi Жыл бұрын
Thanks Mosh! It was very easy to understand.
@mickaelrichard7255
@mickaelrichard7255 3 жыл бұрын
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!
@kumarsonusingh5803
@kumarsonusingh5803 3 жыл бұрын
Thank you this video, really helpful!!
@Joy_Boobo
@Joy_Boobo 6 ай бұрын
#You take your time in teaching✅ # You are audible ❤ # and prepares very well for each class💯. THUMB UP 👍
@jasonmase8860
@jasonmase8860 Жыл бұрын
I love how you teach Mosh.
@shahramsultanian
@shahramsultanian 4 жыл бұрын
thank you Mosh it was Wonderful .
@kitcat2449
@kitcat2449 Жыл бұрын
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!
@snatamohanty6612
@snatamohanty6612 Жыл бұрын
me too! it feels to simple. i'm not used to not having a thousand of errors because of an extra bracket...
@kitcat2449
@kitcat2449 Жыл бұрын
@@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
@snatamohanty6612
@snatamohanty6612 Жыл бұрын
@@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
@kitcat2449
@kitcat2449 Жыл бұрын
@@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 🗿
@jawadtahmeed9854
@jawadtahmeed9854 5 жыл бұрын
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.
@elliotbennett1991
@elliotbennett1991 11 ай бұрын
I found this video very useful. Thank you!!!
@ag36015
@ag36015 4 жыл бұрын
You're very clear in the explaination, thanks a lot
@SEVEN-og1td
@SEVEN-og1td 4 ай бұрын
Thank you so much for this videos they are perfect and free. 🎉
@mekhalakarunaratne1707
@mekhalakarunaratne1707 3 жыл бұрын
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... :)
@alisondefreitas8625
@alisondefreitas8625 Жыл бұрын
That's was really good Mosh Big thank you.
@iamwriting3935
@iamwriting3935 7 ай бұрын
Superb... I love coding with Mosh...❤❤❤
@AllAroundHnadyMan
@AllAroundHnadyMan Жыл бұрын
Excellent education - thanks
@shirkhanaslanzade2406
@shirkhanaslanzade2406 4 жыл бұрын
many thanks, really helpful
@_mil0__
@_mil0__ Жыл бұрын
Your an excellent teacher. Thank you
@mystackquest
@mystackquest 3 жыл бұрын
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?
@kayemmanims
@kayemmanims 7 ай бұрын
Great explanation, Mosh. Thanks a lot
@anurasenarathna1703
@anurasenarathna1703 11 ай бұрын
Very well explained. Thank you
@saeedmohamed9480
@saeedmohamed9480 2 жыл бұрын
I learnt parameters nd argument clearly thank you.
@ee07168
@ee07168 3 ай бұрын
Excellent teaching skills and knowledge great job !!
@timkwok2365
@timkwok2365 Жыл бұрын
I learn a lot, many thx!
@rorolabelli2823
@rorolabelli2823 3 жыл бұрын
The best teacher ever😉💞
@techmedia254
@techmedia254 4 ай бұрын
KZfaq University will never disappoint....am a member....chau
@TechReptile
@TechReptile 3 жыл бұрын
Hi Mosh, You are awesome to teach.
@argjendsejfullai8304
@argjendsejfullai8304 3 жыл бұрын
i wish you were my teacher sir, you earn my respect, sub, like and comment and i hope i pass my python exam. Mosh += love
@liguow
@liguow Жыл бұрын
Very in depth and concise
@lexamitchenterprises
@lexamitchenterprises Жыл бұрын
Thanks for this video, I really appreciate it
@kadenhansen
@kadenhansen Жыл бұрын
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.
@gfpkelly
@gfpkelly 3 жыл бұрын
This is a great video!
@randycny
@randycny 2 жыл бұрын
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!
@nol-sor1985
@nol-sor1985 3 жыл бұрын
You're the best dude 🙏
@alelignfaris1082
@alelignfaris1082 4 жыл бұрын
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
@kapibara2440
@kapibara2440 5 ай бұрын
It was a very interesting tutorial, thank you ❤
@realmaureenoyakhilome
@realmaureenoyakhilome Жыл бұрын
This video is gold. Thanks
@KA-NV
@KA-NV 5 жыл бұрын
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.
@victoreleanya4375
@victoreleanya4375 3 жыл бұрын
Thanks Mosh
@user-vc2tr3fz2p
@user-vc2tr3fz2p 3 жыл бұрын
Great video it was quite helpful
@aminekouchta9616
@aminekouchta9616 Жыл бұрын
really good explanation...keep it up
@mokaddisfarazi2494
@mokaddisfarazi2494 5 жыл бұрын
you are great sir!
@junaidmughal3806
@junaidmughal3806 2 жыл бұрын
best video on functions
@jomelsanpedro7271
@jomelsanpedro7271 3 жыл бұрын
Really talented teacher
@droneguy69
@droneguy69 2 жыл бұрын
Thanks for this Mosh
@MrDuvinci
@MrDuvinci 3 ай бұрын
You are a good teacher
@Shachar50
@Shachar50 Ай бұрын
man thank you so much for that!!
@saralshikhar2422
@saralshikhar2422 3 жыл бұрын
Thank you for this amazing tutorial!!!!
@janusztarnowski115
@janusztarnowski115 2 жыл бұрын
fajn coode is on kzfaq.info/get/bejne/ebOTeNqQrLqcYps.html
@chinwachukwu2622
@chinwachukwu2622 4 жыл бұрын
This is awesome lessons
@ninavanleeuwen1183
@ninavanleeuwen1183 7 ай бұрын
Thank you so much!
@claylanzino9749
@claylanzino9749 3 жыл бұрын
Thanks for sharing 😊
@eleanor.44
@eleanor.44 6 ай бұрын
Thanks a lot sir!
@sawomirolczyk5590
@sawomirolczyk5590 3 жыл бұрын
You are great Mosh :-)
@osho2810
@osho2810 3 жыл бұрын
Amazing...Sir....
Python For Loops - Python Tutorial for Absolute Beginners
14:42
Programming with Mosh
Рет қаралды 552 М.
Python for Beginners - Learn Python in 1 Hour
1:00:06
Programming with Mosh
Рет қаралды 17 МЛН
$10,000 Every Day You Survive In The Wilderness
26:44
MrBeast
Рет қаралды 101 МЛН
1❤️#thankyou #shorts
00:21
あみか部
Рет қаралды 10 МЛН
ПАРАЗИТОВ МНОГО, НО ОН ОДИН!❤❤❤
01:00
Chapitosiki
Рет қаралды 2,8 МЛН
ХОТЯ БЫ КИНОДА 2 - официальный фильм
1:35:34
ХОТЯ БЫ В КИНО
Рет қаралды 2,8 МЛН
Python Functions (The Only Guide You'll Need) #12
17:20
Programiz
Рет қаралды 546 М.
How to Use Lists in Python
18:49
Programming with Mosh
Рет қаралды 286 М.
Functions in Python are easy 📞
10:38
Bro Code
Рет қаралды 384 М.
How To Use Functions In Python (Python Tutorial #3)
14:55
CS Dojo
Рет қаралды 2,3 МЛН
25 nooby Python habits you need to ditch
9:12
mCoding
Рет қаралды 1,7 МЛН
Functions in Python | Introduction | Python for beginners #lec56
24:07
Jenny's Lectures CS IT
Рет қаралды 109 М.
Python lists, sets, and tuples explained 🍍
15:06
Bro Code
Рет қаралды 226 М.
9 Reasons People Hate JavaScript
4:45
Programming with Mosh
Рет қаралды 55 М.
$10,000 Every Day You Survive In The Wilderness
26:44
MrBeast
Рет қаралды 101 МЛН