Pages

Python: Argument in Funtion

Lets talk about the arguments in funtions. As we know so far, we define how many arguments will be used at the start of defining the function.


def something(argv1, argv2):
    print argv1, argv2
  
But if we want add one more or delete one, we must update our codes.

There is another way to define how many arguments will be used.

def something(*tube):
    for i in tube:
        print i
tube = (argv1 , argv2, argv3)