python 利用 join 给字符串加分隔符

#!/usr/bin/python3
# -*- coding: utf-8 -*-
test = "今天吃了吗"
test = "_".join(test)
print(test)
今_天_吃_了_吗

test = "今天吃了吗"
test = " ".join(test)
print(test)
今 天 吃 了 吗

猜你喜欢

转载自www.cnblogs.com/37yan/p/8919797.html