เพิ่ม whitespaces ระหว่างชาร์ไพธอน
s = "BINGO"
print(" ".join(s))
เพิ่มพื้นที่ก่อนและหลังจากข้อความเป็นภาษาไพธอน
using re adds white-space before and after the desired characters:
import re
pat = re.compile(r"([.()!])")
print (pat.sub(" \\1 ", string))
# hello . . . ( world ) !