← Back to challenges

True Ones, False Zeros

PythonHarddata_structuresstringsarraysloops

Instructions

Create a function which returns a list of booleans, from a given number. Iterating through the number one digit at a time, append True if the digit is 1 and False if it is 0.

Examples

integer_boolean("100101") ➞ [True, False, False, True, False, True]

integer_boolean("10") ➞ [True, False]

integer_boolean("001") ➞ [False, False, True]

Notes

Expect numbers with 0 and 1 only.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Check for Anagrams