Page 1 of 1

in python need help understanding. what functions I can use to obtain the results or return. I need to change the bold t

Posted: Thu Jul 14, 2022 2:13 pm
by answerhappygod
in python need help understanding. what functions I can use toobtain the results or return. I need to change the bold to have thereturn I need. Pls help
>>> colors =['Violet', 'Indigo', 'Blue', 'Green', 'Yellow', 'Red']
>>> color_string =dash_stringify(color)>>> color_string'Violet - Indigo - Blue - Green - Yellow -Red'
>>> print(color_string)Violet - Indigo - Blue - Green - Yellow -Red
>>> nums = [1, 2, 3]>>> dash_stringify(nums)Traceback [...]
[...]TypeError: sequence item 0: expected str instance, intfound
>>> dash_stringify(['1', '2', '3'])'1 - 2 - 3'>>> dash_stringify(['A', 'B', 'C'])'A - B - C'>>> dash_stringify(['Acolor'])'A color'