Question: Write a function that takes three parameters: list of symbols ( as characters ) , list of repetitions ( as positive integers ) , and

Write a function that takes three parameters: list of symbols (as characters), list of repetitions (as positive integers), and a boolean. Note that the lists can be of any length but lengths of these lists will always be the same. Your function returns a string containing characters from the symbols list repeated the corresponding number of times if the boolean parameter is True, and reversed otherwise. If both lists are empty, return an empty string. For example, Input Output Reason ['-','+'],[4,5], True ----+++++- is repeated 4 times, + is repeated 5 times and everything is put together. def fourth_pattern(symbols, repeats, switch): """>>> fourth_pattern(['-','+'],[4,5], True)'----+++++'>>> fourth_pattern(['-','+'],[4,5], False)'+++++----'"""

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!