Python Functions (The Only Guide You'll Need) #12

preview_player
Показать описание
A function is a group of related statements that performs a specific task. Functions make our program more organized and manageable by dividing it into smaller and modular chunks.

In this video, we will learn about Python functions. We will also learn about function arguments and the return statement. At the end of the video, we will learn to write a custom function to find the average marks and the corresponding grade for a university student.

~

Watch our videos and revise them with our Python App!

Timestamps:
0:00 Intro
0:28 Python Functions
4:16 Function Arguments
6:00 Passing Multiple Arguments
7:31 return Statement
9:31 Types of Python Functions
11:36 Example: Compute Grade of a Student
15:31 Programming Task
16:01 Recap

Find Programiz elsewhere:
-------------------------------------------------

Python Functions (The Only Guide You'll Need) #12

#python #learnprogramming #programiz
Рекомендации по теме
Комментарии
Автор

🔥Finding it Damn Hard to Understand Python?
Learn to code—the right way—with interactive lessons, quizzes & challenges. Build a strong programming base; it's IMPORTANT!

programizstudios
Автор

Your channel is severely underrated. You have a talent at explaining things coherently, keep up the good work.

ginch
Автор

This is by far the most clear and complete explanation of FUNCTIONS I've seen. And I have seen plenty of python for beginners videos. I specially liked the animations showing "how this program works." Believe it or not, it made the difference in my total understanding of... well.... how the program worked! Keep it up.

MrSeinfeldFan
Автор

Great stuff Punit !
43 years old and learning Python. Good luck everybody.

DamienThorn
Автор

This is probably the best resource I've found for learning fundamentals of Python in an UNDERSTANDABLE way.. You have a natural ability to explain concepts in a clear, yet concise manner. The arrows and all of the visual indicators also help greatly for being able to visually see how things execute. Very high quality and hugely underrated channel.

enzy
Автор

Punit, your content is better than a lot of the paid content I have seen out there. It's well thought-out, well-explained, easy to understand, and I think I could cry at the difference, sometimes. I hope your channel blows up in popularity; it would be so well-deserved.

jmie
Автор

I learned more in this 15 minute video than what I learned from one week in school. thankyou much appreciated

frenchfatfather
Автор

Very, Very, VERY GOOD explanations! I have a difficult time filling in the smaller bits of connections/explanations as to why certain things flow/execute. I appreciate how you were thoroughly explaining ALL the steps without leaving them up to the student to infer (like a lot of the study material leaves the student left to magically infer).

victorrivas
Автор

This is by far the best channel out there for learning Python. I'm a beginner and the way you explain things makes it so easy! Will definitely be downloading the app.

DaniFifaHD
Автор

I really want to thank you for your videos. I was having trouble understanding the way the code works as described in my textbook. You have a way of explaining things that is easy to understand. I love how you show us the path the coding is taking. I feel like I have a deeper understanding of it now.

bdank
Автор

These Python tutorials are doing the world a huge favor. Keep inspiring!

kabayanhustler
Автор

The only function tutorial i needed. The animation of how it works really helped.

simonshrestha
Автор

why is this guy so good at teaching python? honestly most helpful video i have ever come across

aleezashahnawaz
Автор

Example: Compute Grade of a Student
marks = ([ 55, 64, 75, 80, 65])
Sum = sum( marks )
average = Sum / 5
average = (int(average))
if average >= 80:
print ("You got A Grade")
print ("Your marks are", average)
if average >= 60 and average < 80:
print ("You got B grade")
print ("Your marks are", average)
if average >= 50 and average < 60:
print ("You got C grade")
print ("Your marks are", average)
if average < 50:
print ("You got B grade")
print ("Your marks are", average)

Legend-guuz
Автор

Sir the topic i have tried to read and or otherwise rote learn for the sake of exams for 100s of times, you just simplified in a 15min video! Thank you very much

Vijay_helo
Автор

The arrow animations and various type of examples made this video better than others

lakshya
Автор

Thank you for this video. This is my second attempt for a university course that uses python. I never had a clear understanding with how def functions work. The professor has to cover recursion and it makes it inconvenient to understand functions. Hopefully this helps.

kenpachicg
Автор

This is the most simplified tutorial I have ever found . You explain fucntion in a clear way

samikshyanmishra
Автор

You're such a good teacher! because of your explanations i was able to make the code where you need to enter the marks first before it starts calculating. it took me a while thought but thanks!

print ('enter your marks')

mark1 = int(input('enter your first mark:'))
mark2 = int(input('enter your second mark: '))
mark3 = int(input('enter your 3rd mark: '))
mark4 = int(input('enter your 4th mark: '))
mark5 = int(input('enter your 5th mark: '))

def find_average_marks(marks):
sum_of_marks = sum(marks)
total_subjects = len(marks)
average_marks = sum_of_marks / total_subjects
return average_marks

def compute_grade(average_marks):
if average_marks >= 80:
print ('Congratulations you passed your exams with a average of', average_marks, 'your grade is A')
elif average_marks >= 60:
print ('congratulations you passed your exams with a average of: ', average_marks, 'your grade is B')
elif average_marks >= 50:
print ('congratulations you passed your exam with a average of: ', average_marks, 'your grade is C')
elif average_marks <= 50:
print ('your failed your exam with a average of: ', average_marks, 'your grade is F')
return

marks = [mark1, mark2, mark3, mark4, mark5]
average_marks = find_average_marks(marks)

grade = compute_grade(average_marks)

karolus
Автор

Thanks! I spaced out during my class so I was confused about this concept the entire time. Came to youtube and found your video and I think I get it now

suhgy