Last active
December 20, 2015 21:18
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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