Functions - Python for Absolute Beginners Course

Published: 07 June 2022
on channel: Programming With Nick
307
19

In this Python for beginners tutorial we are going to learn the following:
How to create a Function
When to use a Function

In this video, we are going to learn about functions, a very important and very useful tool.

A function is just a block of code with a name given by us. If in our program we need to use the same block of code over and over again instead of writing the same block of code many times, we write it once, we give it a name, that’s the function name, and when we need to run it, we just “call” it, as we say.

To define a function, we need to type the keyword def like this:

def (from define) function_name():
block of code

def the function name open and close parenthesis colon two spaces and the block of code we want to belong to the function. Each command, to belong to a function, must be indented with two spaces.

#pythoncourse #pythontutorial #programmingwithnick


Watch video Functions - Python for Absolute Beginners Course online without registration, duration hours minute second in high quality. This video was added by user Programming With Nick 07 June 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 307 once and liked it 19 people.