Python'da fazladan boşluk olmadan bir dizeye nasıl katılabilirim
Kod örnekleri
0
0
python dizesinden önce ve sonra boşluk ekleme
using re adds white-space before and after the desired characters:
import re
pat = re.compile(r"([.()!])")
print (pat.sub(" \\1 ", string))
# hello . . . ( world ) !