my-first-blog

一种有趣的字符串去空格写法

1
2
3
4
5
6
from functools import reduce
def not_space(ch):
if ch!=' ':
return True
chlist=list(filter(not_space, "he llo world"))
print(reduce(lambda x,y:x+y,chlist))

my-first-blog
http://example.com/2025/03/30/my-first-blog/
作者
John Doe
发布于
2025年3月30日
许可协议