Created
December 4, 2020 02:40
-
-
Save junetech/2001664bffd82a7639c1f9224dd660a2 to your computer and use it in GitHub Desktop.
Python if statement test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def if_bool_value(any_input): | |
_str = f"For if statement, {any_input} of {type(any_input)} is" | |
if any_input: | |
print(_str, True) | |
else: | |
print(_str, False) | |
if_bool_value(1) | |
if_bool_value(2) | |
if_bool_value(0) | |
if_bool_value("False") | |
if_bool_value("") | |
if_bool_value([False]) | |
if_bool_value(list()) | |
if_bool_value(tuple()) | |
if_bool_value(dict()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment