Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Splat (*) arguments example from Codecademy. A splat argument allows for an unknown quantity of arbitrary arguments to be processed in a function.
# Sample function that utilizes the splat (*) argument to accept multiple input strings
# A Codecademy Python assignment
# Dr. Steven B. Combs, coding novice
def favorite_actors(*actors):
"""Prints out your favorite actorS (plural!)"""
print "Your favorite actors are:" , actors
favorite_actors("Michael Palin", "John Cleese", "Graham Chapman")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.