← Back to challenges

Boolean to String Conversion

PythonMediumbit_operationsconditionslogicstrings

Instructions

Create a function that takes a boolean variable flag and returns it as a string.

Examples

bool_to_string(True) ➞ "True"

bool_to_string(False) ➞ "False"

Notes

  • Don't forget to return the result.
  • If you get stuck on a challenge, find help in the Resources tab.
  • If you're really stuck, unlock solutions in the Solutions tab.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Correct the Mistakes