Skip to content

Instantly share code, notes, and snippets.

@RaMSFT
Created October 11, 2022 02:41
Show Gist options
  • Select an option

  • Save RaMSFT/afcd6c15ac76c2b7ab7e8c498966508a to your computer and use it in GitHub Desktop.

Select an option

Save RaMSFT/afcd6c15ac76c2b7ab7e8c498966508a to your computer and use it in GitHub Desktop.
def bool_to_string(flag):
"""Convert a boolean value to a string
Args:
flag (boolean): boolean value to convert into string
Returns:
string: boolean to string result
"""
return str(flag)
input = False
result = bool_to_string(input)
print(f"input: {input}, input type: {type(input)}, output: {result}, output Type: {type(result)}")
input = True
result = bool_to_string(input)
print(f"input: {input}, input type: {type(input)}, output: {result}, output Type: {type(result)}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment