0

In this code, what is the points of the * behind the args function?

def biggest_number(*args):
  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(-64, 72, 94, 61, 0)
distance_from_zero(874)
Robert
  • 7,394
  • 40
  • 45
  • 64

1 Answers1

1

The * star before args indicates that we're accepting a list of argument values, which is forwarded along to the min / max functions.

J_H
  • 17,926
  • 4
  • 24
  • 44