Skip to content

Instantly share code, notes, and snippets.

@stevencombs
Last active December 20, 2015 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevencombs/6196425 to your computer and use it in GitHub Desktop.
Save stevencombs/6196425 to your computer and use it in GitHub Desktop.
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