【发布时间】:2020-09-23 17:01:20
【问题描述】:
我将如何编写使用lambda函数和应用或映射代码?我看过几篇博客文章等,但由于某种原因,我觉得我错过了一些东西。我觉得应该真的很简单。
for i in range(2,5):
print(f'I only have {i} friends, but they are awesome.')
# I only have 2 friends, but they are awesome.
# I only have 3 friends, but they are awesome.
# I only have 4 friends, but they are awesome.
【问题讨论】:
-
你不会的。循环是执行一系列语句的适当和首选方式。
标签: python for-loop iteration apply