Functions:
A function is a block of code which only runs when it is called. We can pass data, known as parameters or we can also say arguments or signature into a function. A function can return data as a result.
Creating a Function in Python:
In Python, we create a function by using the def keyword.
def result():print("welcome to Engine-4-Geeks")
Calling Function:
def result():print("welcome to Engine-4-Geeks")result()
Passing argument in Function:
We can pass some information as an argument in python function. Arguments are specified after the function name, inside the parentheses. You can add as many arguments as you want, just separate them with a comma.
def naming(name):print("Name : "+ name)naming("John")naming("Joe")naming("Lava")
0 Comments
Doubts? Please let our team know So that we can serve you better.