Skip to content

Instantly share code, notes, and snippets.

@codewithpom
Created July 13, 2021 11:44
Show Gist options
  • Save codewithpom/3bc37c9ba9f6ebae950b7701201ec9b8 to your computer and use it in GitHub Desktop.
Save codewithpom/3bc37c9ba9f6ebae950b7701201ec9b8 to your computer and use it in GitHub Desktop.
Declare bool in python
i_am_programmer = True
# The above example creates a variable and assigns it as True
i_am_not_a_programmer = False
# The above example creates a variable and assigns it as False
# or you can do this
i_am_programmer = bool(1) # 1 or any number except 0
i_am_not_a_programmer = bool(0) # 0 is the only number which can assign False
# Have fun while Programming.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment