# str.replace(旧字符,新字符,替换次数(默认全部替换))
strvar ='3*77+33*77+333*77'
strvar2=strvar.replace('3*77','231')
print(strvar2) #输出为 231+3231+33231
strvar3=strvar.replace('3*77','231',1)
print(strvar3) #输出为 231+33*77+333*77
# str.replace(旧字符,新字符,替换次数(默认全部替换))
strvar ='3*77+33*77+333*77'
strvar2=strvar.replace('3*77','231')
print(strvar2) #输出为 231+3231+33231
strvar3=strvar.replace('3*77','231',1)
print(strvar3) #输出为 231+33*77+333*77