As we start to add more code our program gets messy and hard to read so in all programming languages when we have a large amount of code we break them into small parts called as functions. These have different names in different programming languages sometimes they are called as modules, subroutines or subprogram.
Functions are extraordinarily important in Computer programming it will be very very hard to do programming without functions.
Comments are very useful when it came to writing a big program or working on a big project. These are usually meant for increasing the understandability of a code. It’s a good practice “to comment what/how your code does”.
In Python, we can describe a comment using # symbol.
The way to create functions in Python is easy and can be done in seconds.
print('Hello, from Fuction')
Things to note here:
In python, we define the function using def keyword followed by the function name.
Using an indentation we write statements or block of code that we want our function to perform.