Joining
In two previous chapters, we considered methods that split a string into a list. Now we will learn the method that will do the opposite thing.
To join all the elements of iterable object obj
(like tuple, list, dictionary or set) use the following syntax: separator.join(obj)
, where separator
is the string used to separate objects for join. If obj
is dictionary, then its keys will be joined. For example,
12print(", ".join(['Python', 'R', 'SQL'])) print(" - ".join(('1', '2', '3')))
Swipe to start coding
You are given the list of strings splitted_string
. You need to join these strings separated by dot and space into one sentence.
Løsning
Takk for tilbakemeldingene dine!
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Awesome!
Completion rate improved to 4.35Awesome!
Completion rate improved to 4.35
Joining
In two previous chapters, we considered methods that split a string into a list. Now we will learn the method that will do the opposite thing.
To join all the elements of iterable object obj
(like tuple, list, dictionary or set) use the following syntax: separator.join(obj)
, where separator
is the string used to separate objects for join. If obj
is dictionary, then its keys will be joined. For example,
12print(", ".join(['Python', 'R', 'SQL'])) print(" - ".join(('1', '2', '3')))
Swipe to start coding
You are given the list of strings splitted_string
. You need to join these strings separated by dot and space into one sentence.
Løsning
Takk for tilbakemeldingene dine!
single
Awesome!
Completion rate improved to 4.35
Joining
Sveip for å vise menyen
In two previous chapters, we considered methods that split a string into a list. Now we will learn the method that will do the opposite thing.
To join all the elements of iterable object obj
(like tuple, list, dictionary or set) use the following syntax: separator.join(obj)
, where separator
is the string used to separate objects for join. If obj
is dictionary, then its keys will be joined. For example,
12print(", ".join(['Python', 'R', 'SQL'])) print(" - ".join(('1', '2', '3')))
Swipe to start coding
You are given the list of strings splitted_string
. You need to join these strings separated by dot and space into one sentence.
Løsning
Takk for tilbakemeldingene dine!