alphabet = "a b c d e f"
tstr = alphabet.split()
for c in tstr:
طباعة c
alphabet = "a b c d e f"
tstr = alphabet.split(" "، 3)
for c in tstr:
طباعة c
< / pre> وقت التشغيل:
< pre class = "prettyprint" >a
b
c
d e f
< / pre>
المثال 2: استخراج اسم المجالs = 'exemple.domaine.net'
i = s.split('.', 1)
nom_de_domaine = i [1]
print nom_de_domaine
< / pre>وقت التشغيل:
< pre class = "prettyprint" >domaine.net< / pre> المراجع:
Python String split() الطريقة< / a>< / div>
Please disable your ad blocker and refresh the window to use this website.