Skip to content

Instantly share code, notes, and snippets.

@chankeypathak
Created June 19, 2017 06:21
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 chankeypathak/b88ea4894c63c69c3c070f5f71dc4382 to your computer and use it in GitHub Desktop.
Save chankeypathak/b88ea4894c63c69c3c070f5f71dc4382 to your computer and use it in GitHub Desktop.
Python snippets
if any(bad in name for bad in NOT_ALLOWED):
raise ValueError("'name' may not contain any of {}".format(NOT_ALLOWED)
if not all(isinstance(val, int) for val in DATA) or len(DATA) !=2:
raise ValueError("'DATA' must consist of 2 ints")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment