字符串方法链式调用

message = 'hello, world!'
print(message.replace('o', 'O').replace('l', 'L').replace('he', 'HE'))

 # HELLO, wOrLd!

posted @ 2023-05-31 23:02  sangern  阅读(16)  评论(0)    收藏  举报