只是一个简单的Python Replace()函数

2024-04-25 22:25:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我是Python初学者,尝试使用replace函数,遇到了以下问题:

quote="Inquiring the application issues"
t=quote.title()        
print(t)                #prints "Inquiring the Application Issues"        
t=t.replace("the","a")  #try to replace "the" to "a" in the title-formatted quote
print(t)               #still prints "Inquiring the Application Issues", "the" didn't get replaced

有人能指出我的问题吗?非常感谢!你知道吗


Tags: theto函数applicationtitleprintsreplacequote