What's the * symbol for in Python Function's lesson 12?


where it goes

def biggest_number(*args): #What's the * symbol for??
print max(args)
return max(args)

def smallest_number(*args):
print min(args)
return min(args)

def distance_from_zero(arg):
print abs(arg)
return abs(arg)

biggest_number(-10, -5, 5, 10)
smallest_number(-10, -5, 5, 10)


Hi @scriptpro10617 ,

The *args parameter provides for 0 or more positional arguments, which are accessible inside the function via a list named args. Any other valid name can be used instead of args, following the asterisk. Whatever name follows the asterisk becomes the name of the list that is used to access the arguments that were used in the function call.