Write various python modules convert the list to generate the output "one, two, three" ? a = [‘one’, ‘two’, ‘three’]
Answers
Answered by
0
Answer:
> > > a = [‘one’,’two’,’three’] >>> ‘,’.join(a) ‘one,two,three’Read more on Sarthaks.com - https://www.sarthaks.com/131590/write-various-python-modules-convert-the-list-generate-output-one-two-three-one-two-three
please mark me as brainliest please
Answered by
0
Python modules
Explanation:
Make a list consisting one,two,three
It looks like [‘one’,’two’,’three’]
In order to print as ‘one,two,three’
We have to use join in python:
JOIN is a string method on python which joins all the elements of list or tuple into a string
SYNTAX:
‘ (separator)‘.join(list_name)
Here separator is ,
List_name is A
A=[‘one’,’two’,’three’]
In python interpreter or console
>>> a = ['ONE','TWO','THREE']
>>> ','.join(a)
'ONE,TWO,THREE'
Similar questions
Science,
4 months ago
Math,
4 months ago
Computer Science,
8 months ago
Math,
10 months ago
Hindi,
10 months ago