Wiersz python dodaje spacje wokół określonej pozycji
Przykłady kodu
0
0
dodać spację przed i po wierszu python
using re adds white-space before and after the desired characters:
import re
pat = re.compile(r"([.()!])")
print (pat.sub(" \\1 ", string))
# hello . . . ( world ) !