Skip to content

Instantly share code, notes, and snippets.

@pointofpresence
Last active June 13, 2022 15:41
Show Gist options
  • Save pointofpresence/74123ec7537179ffc72b9819e51a8e4b to your computer and use it in GitHub Desktop.
Save pointofpresence/74123ec7537179ffc72b9819e51a8e4b to your computer and use it in GitHub Desktop.
Check if string empty
# Empty strings are "falsy" (python 2 or python 3 reference),
# which means they are considered false in a Boolean context, so you can just do this:
if not myString:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment