题解 | #拯救被污染的字符串#

拯救被污染的字符串

http://www.nowcoder.com/practice/a86ecd1cd0224d5094c68c05233c7dad

NP41 拯救被污染的字符串

思路:

step1:首先用split()切割,返回的就是列表;
step2:用join()拼接;

代码如下:

my_str = 'I am$ N$iuniu$, an$d I $am stu$dying in $Now$coder!'
my_list = my_str.split('$')
print(my_list)
print(''.join(my_list))
全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务