How to define and use functions in python ?

In this post, we will look how to define and use functions in python.

To understand this, lets see an example below.

Using Functions in Python

In python, the function is defined using “def” keyword.

user@ngelinux$ cat 

def hello(name):
  print("Hello how are you %s" %name)

hello("NGELinux User")



user@ngelinux$ ./ 
Hello how are you NGELinux User

Leave a Reply

Your email address will not be published.