Skip to content

Instantly share code, notes, and snippets.

@dichharai
Last active May 14, 2019 05:02
Show Gist options
  • Save dichharai/af336f8fc3636b7d3368cc86af9793e6 to your computer and use it in GitHub Desktop.
Save dichharai/af336f8fc3636b7d3368cc86af9793e6 to your computer and use it in GitHub Desktop.
# continuation of settattr-eg.py example
# output: reese's contains nuts? : False
print('reese\'s contains nuts? : ' + str(getattr(reese, reese.list_of_choco_ingrie['IS_NUTTY'], False)))
# output: godvia contains nuts? : True
print('godvia contains nuts? : ' + str(getattr(godiva, godiva.list_of_choco_ingrie['IS_NUTTY'], False)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment