Question: python: Use the Design Recipe to write a function bools_2_str , which consumes a list of booleans and returns a string of the same length
python:
Use the Design Recipe to write a function bools_2_str, which consumes a list of booleans and returns a string of the same length as the list. Where the list has True, the string should have 'X', and where the list has False, the string should have ' ' (i.e., a single space).
Write 3 assertEqual statements to test your function.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
