10. Functions [Python 3 Programming Tutorials]
Vložit
- čas přidán 20. 07. 2024
- In today’s session, we will talk about “functions” in python. The video will explain the introduction of “functions”, why “functions” are needed, encapsulate code in a function, default arguments, the difference between “local and global variables” and “document strings”.
Exercise: github.com/codebasics/py/blob...
Topics that are covered in this Video:
0:00 Functions introduction
0:54 why functions are needed
3:09 encapsulate code in function
3:24 Define function
10:22 Name argument
11:09 Global vs Local Variables
12:47 Default variable
14:14 Document strings
Do you want to learn technology from me? Check codebasics.io/ for my affordable video courses.
Next Video:
11. Dictionaries and Tuples [Python 3 Programming Tutorials]: • 11. Dictionaries and T...
Website: codebasics.io/
Facebook: / codebasicshub
Twitter: / codebasicshub
Do you want to learn python from me with a lot of interactive quizzes, and exercises? Here is my project-based python learning course: codebasics.io/courses/python-for-beginner-and-intermediate-learners
According to PEP 8 it's important to skip 2 lines after function block. Just for beginners to pay attention on that
Extremely glad to watch all your videos regarding python and data science. You explained it not only quiet well but extremely well. Thank you. Looking forward to watch all your upcoming lessons.
Loving your simplicity and evenly broken module.Would it be possible for you to make a video series with Project like Data Science.Thank you
Really clear explanation sir,Great work. Thank you so much
A helpful video to make clarity on if condition, for loop etc.
Loving this series. Any chance you are going to make a series on Data Structures and Algos in the future? Would really love to learn from you.
I already have a series (I am working on adding algo videos but DS videos are already there). in youtube search "codebasics data structures and algorithms in python"
Here is the link of exercise along with the solution, please work on it as it will make your learning solid: github.com/codebasics/py/blob/master/Basics/Exercise/10_functions/10_functions_exercise.md
page not found
page not found
page not found
Great hard work really appreciate your simplicity in explaining beginners.Thanks sir.
😇👍
This is awesome code man,thanks a lot. God bless you
You're welcome!
you are really great sir,i respect your altruistic work
Prakhar, I am happy this was helpful to you
What is the meaning of def add_numbers(file:tel_num:set)->set:
Pass
Why do we need 2nd loop to print stars when we can do it with just a single main for loop?
while using default argument letting b=0 if we give variables as user input and then it shows error sir. How can we overcome it?
Learn data science with python and pandas: czcams.com/video/CmorAWRsCAw/video.html
do u have practice questions which i can use to practice codes
In your exercise solution for printing stars, two loops are used . I used the below code to get the same solution. Can i have your comment on this, please
def printStars(endNumber) :
total = ""
for i in range(1,endNumber+1) :
total += "*"
print(total)
printStars(5)
def print_pattern(num_lines=5):
for i in range(num_lines):
print("*" * (i+1))
return None
print("Print pattern with input=4")
print_pattern(4)
print("Print pattern with input=6")
print_pattern(6)
print("Print pattern with no input")
print_pattern()
You should be in teaching field not in industry. Academics need people like you for good understanding of programming.
I am moving to teaching field by teaching on CZcams already ☺️
in the solution for print * can we not use just one for loop like below
def print_pattern(num):
n = range(num+1)
for value in n:
print (value * "*")
pulp = print_pattern(3)
print(pulp)
Thank you for your helpful.
Glad it was helpful!
Sir why haven't you included **ke for giving multiple arguments in a fn
Thanks sir
great
Excellent video!
There's an exercise? I can't find it here.
In description and pinned comment :)
i am super gladd i found this damnnnnnn!
Glad you enjoyed it
You've mentioned that you have posted exercises after each video. Can't seem to find them. Can you please post a link to the exercises? Your tutorials are great and working on exercises after them would help to fix them.
Actually I am realizing I had posted them in my old series which had a background music. Many people didn't like the music so I had to make the playlist private. Also not all tutorials had an exercise. Can you do one thing? Go to my GitHub repo. GitHub.com/codebasics/py there you will find a folder called basics/Hindi. Here there are tutorials along with exercises description which is in .md file and that will have an exercise as well as a link for a solution
I am also going to do a new series on python with better content and exercises
@@codebasics Appreciate your efforts. Thank you
@@codebasics Hello thanks for your Python tutorial. As mentioned by you, when can we expect new series on Python. Actually, I am about to learn Python. So asking. Thanks in advance for your answer.
I want to learn machine learning and AI will this course be effective to my path?
Yes it should be. After finishing python tutorials I have pandas tutorials playlist and machine learning tutorials so you can watch them
@@codebasics thanks teacher
where is the smaple exercises?
Sir i could understand
Sir mere Jupiter me error bta rha h
Anyone Please explain that line total = total + item icant understand
wallaahhhh
sir i wanna internship. if you give
Professor....
Im sorry sir., Its difficult to understand the exercise., I try to make it by myself without looking solution, for example, the exercise say, input value., So I try to make user put an input.,then i got blur, i go to the solution, the input is already given.
@Meen Prasad Jaisi thank you sir
everything checked but i still got result as:
Tom Expenses: 2100
Joe Expenses: 200
actually same here...idk why is this happening