What is the use of join() for a string rather than list or tuple method?



What is the use of join() for a string rather than list or tuple method?..

Answer / chaitanya

The functions and the methods that are used for the functionality uses the string module. This string module is represented as by using the join function in it:

", ".join(['1', '2', '4', '8', '16']) that results in "1, 2, 4, 8, 16"

The string variable that is used provide a fixed string literal to allow the names that are used to be bounded to the strings. join() is a string method that is used to provide a separator string to use the function over the sequence of the string and insert the function to an adjacent elements. The method uses any number of arguments that follow some rules that has to be put up for the sequence objects that the class defines for itself. The join is used for the string module that is used to join the string characters together as it is given in the program. The example is given as:

string.join(['1', '2', '4', '8', '16'], ", ")

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What are accessors, mutators, @property?

0 Answers  


Which is better java or python?

0 Answers  


list some of the data science libraries in python

0 Answers  


Is set iterable python?

0 Answers  


Can I learn python without knowing programming?

0 Answers  






What are the different file-processing modes with python?

0 Answers  


What is special about python?

0 Answers  


Is google made with python?

0 Answers  


What does netflix use python for?

0 Answers  


What is the python syntax for switch case statements?

0 Answers  


Is Python good for backend?

0 Answers  


Find all occurrences of a substring in Python

0 Answers  


Categories