PYTHON-错误-函数有返回值未接收导致替换不成功

#1.有返回值,没有赋值,替换不成功
cxj = ‘guapi‘
cxj.replace(cxj,‘2b‘)
print(cxj)

#2.有返回值,赋值,替换成功
cxj = ‘guapi‘
cxj = cxj.replace(cxj,‘2b‘)
print(cxj)

相关推荐