Question: 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

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).

Test = print(bools_2_str([True,False,True,False,True]))

Result = 'X X X'

python Language

 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!