replace()

a = 'dv gbrg 1'
a = a.replace(' ','')#用后面的取代前面的
print(a)


dvgbrg1

原文地址:https://www.cnblogs.com/tingtin/p/12568985.html