Skip to content

Instantly share code, notes, and snippets.

@lxneng
Created July 20, 2012 04:45
Show Gist options
  • Save lxneng/3148743 to your computer and use it in GitHub Desktop.
Save lxneng/3148743 to your computer and use it in GitHub Desktop.

Instead of:

if s.startswith('http://') or s.startswith('https://'): ...

You can do:

if s.startswith(('http://', 'https://')): ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment