Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What are docstrings in python?

831


Does python has private keyword in python ? How to make any variable private in python ?

762


How does the ternary operator work in python?

835


Why is numpy so fast?

884


How to redirect the output of a python script from standout(ie., A monitor) on to a file?

879


What are the benefits of using python? What do you understand of pep 8?

824


Why pandas is used in python?

831


What is a docstring?

828


Which version of python is best?

824


Should I learn r or python first?

900


Write a program to draw a board ex: 3by3 or 4by4 etc?

743


What tools can be used to unit test your python code?

859


What is the best notepad?

757


What is sphinx python?

848


What does len () mean in python?

813