alphabet = "a b c d e f"
tstr = alphabet.split()
для c в tstr:
print c
aФункция split() также принимает в качестве параметра максимальное количество обнаружений символа или шаблона, как показано в примере ниже:
b
c
d
e
f
alphabet = "a b c d e f"Runtime:
tstr = alphabet.split(" ", 3)
for c in tstr:
print c
a
b
c
d e f
s = 'exemple.domaine.net'Runtime:
i = s.split('.', 1)
nom_de_domaine = i[1]
print nom_de_domaine
domaine.netReferences:
Please disable your ad blocker and refresh the window to use this website.