Skip to content

Instantly share code, notes, and snippets.

@herberthamaral
Created November 9, 2011 16:42
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 herberthamaral/1352020 to your computer and use it in GitHub Desktop.
Save herberthamaral/1352020 to your computer and use it in GitHub Desktop.
def minhafunc(argumento1, argumento2):
if argumento1 > argumento2:
raise Exception('Erro: argumento1 precisa ser menor que argumento2')
args = (3,2)
minhafunc(*args) #erro
kwargs = {'argumento1':1, 'argumento2':2}
minhafunc(**kwargs) # ok :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment