merhaba arkadaşlar başlık doğru oldu mu emin değilim ama ben bir şey merak ettim. Acaba pythonda stringde virgülle ayrılmış kelimeleri nasıl bulabiliriz mesela şu stringi
forum,yazbel,com
nasıl şu liste çeviririz
forum
yazbel
com
merhaba arkadaşlar başlık doğru oldu mu emin değilim ama ben bir şey merak ettim. Acaba pythonda stringde virgülle ayrılmış kelimeleri nasıl bulabiliriz mesela şu stringi
forum,yazbel,com
nasıl şu liste çeviririz
forum
yazbel
com
merhaba, split
fonksiyonu var stringlerin, onunla yapabilirsiniz
Signature: str.split(self, /, sep=None, maxsplit=-1)
Docstring:
Return a list of the words in the string, using sep as the delimiter string.
sep
The delimiter according which to split the string.
None (the default value) means split according to any whitespace,
and discard empty strings from the result.
maxsplit
Maximum number of splits to do.
-1 (the default value) means no limit.
"forum,yazbel,com".split(",")
cumle = "Bugün, hava, çok, güzel. \$%()\{\}\ forum,yazbel,com"
for noktalama in '''-|\$%(){}[]"'.,!:;/''':
cumle=cumle.replace(noktalama,' ')
cumle = cumle.lower()
cumleKelimeleri = cumle.split()
for kelime in cumleKelimeleri:
print(kelime)
pythonAnlama/kelimeSiralamaca.py at main · sezginibis/pythonAnlama (github.com)