dictionaries and strings 'berlin at pms split(':'['berlin' at pm' split(['berlin:'' '' ''at'' ''pm'the split method has an inversecalled joinwhich is used to put list of strings together with delimiter in betweenstrings ['newton''secant''bisection''join(strings'newtonsecantbisectionnotice that we call the join method belonging to the delimiter ''which is string objectand pass the list of strings as an argument if we want to put the same list together separated by whitespacewe would simply replace 'join(stringsin the example above with join(stringssince split and join are inverse operationsusing them in sequence will give back the original stringas in the following examplel 'oslo at pmwords split( join(wordsl = true common use case for the join method is to split off known number of words on line say we want to read file in the following formatand combine the city name and the country into single stringtromso norway molde norway oslo norway stockholm sweden uppsala sweden the following code will read such file and create nested dictionary containing the data cities {with open('cities txt'as infilefor line in infilewords line split(name 'join(words[: ]data {'lat'float(words[ ])data['pop'int(words[ ]cities[namedata 'long':float(words[ ])here the line name 'join(words[: ]will create strings such as 'tromsonorway'which are then used as dictionary (keysthe value associated with each key is dictionary containing the latitude and longitude data in most of the examples considered so far we have mostly used split for processing text files line by linebut in some cases we have string with