0


Python使用reduce实现字符串逆序

from functools importreduce

astr ='123'print(reduce(lambda x, y: y + x, astr))

输出:

321
标签: python

本文转载自: https://blog.csdn.net/lycwhu/article/details/125693561
版权归原作者 Channing Lewis 所有, 如有侵权,请联系我们删除。

“Python使用reduce实现字符串逆序”的评论:

还没有评论