This article mainly introduces the use of the Join () method in Python, which is the basic knowledge of Python's introduction, and needs friends to refer to the following
The join () method returns a string element in a sequence that is joined by STR-delimited strings.
The following is the syntax for the Join () method:
Sequence-This is the order of the elements to be connected.
This method returns a string that is concatenated in the sequence SEQ string. The separator between elements is string str.
The following example shows the use of the Join () method.
|1 2 3 4 5||#!/usr/bin/python str = "-"; Seq = ("A", "B", "C"); # This is sequence of strings. Print str.join (seq);|
When we run the above program, it produces the following results: