编写程序检查字符串Life is short I use python中是否包含字符串python若包含则替换为Python后输出新字符串否则输出原字符串。
s = "Life is short. I use python" if "python" in s: s = s.replace("python", "Python") print(s) else: print(s)
原文地址: https://www.cveoy.top/t/topic/cEn0 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
s = "Life is short. I use python" if "python" in s: s = s.replace("python", "Python") print(s) else: print(s)
原文地址: https://www.cveoy.top/t/topic/cEn0 著作权归作者所有。请勿转载和采集!