question = "What is the air speed velocity of \
an unlaiden swallow?"
print question
question2 = question.replace("swallow", \
"European swallow")
print question2
question3 = question.replace("swallow", \
"African swallow")
print question3
replace_str.py
What is the air speed velocity of an unlaiden
swallow?
What is the air speed velocity of an unlaiden
European swallow?
What is the air speed velocity of an unlaiden
African swallow?
Output from replace_str.py code
原文:<<
[声明]:限于译者水平,文中难免错漏之处,欢迎各位网友批评指正;
没有评论:
发表评论