Example & Tutorial understanding programming in easy ways.

What does the *args do in python?

With the Help of *arg, we can pass variable number of arguments in Function calling.

Example:

def func(arg):

       print(sum(arg))

func(1,2,3)

// it will give an error


Solution :

def func(*arg):

       print(sum(arg))

func(1,2,3)

// output is 6

Read More →