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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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'
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply