fork download
  1. #Python字符串操作
  2. msg = "hello 123 WORLD"
  3. #将字符串中的"WORLD"替换为"Python"
  4. re_list = msg.replace("WORLD","Python")
  5. #将整个字符串转换为小写
  6. last_list = re_list.lower()
  7. print("将字符串中的WORLD替换为Python,然后将整个字符串转换为小写:",last_list)
Success #stdin #stdout 0.12s 14132KB
stdin
Standard input is empty
stdout
将字符串中的WORLD替换为Python,然后将整个字符串转换为小写: hello 123 python