题解 | #网页的生成#

网页的生成

https://www.nowcoder.com/practice/eafb4afa3d504fcaadf313bdd4b90148

num = input()
old_list = num.split()
new_list = list(map(lambda i:int(i),old_list))

def height(num): #定义函数 打印原来函数两倍的数值
    print(num*2)

for i in new_list: #遍历转换为int数据类型的数据 并每次都调用height函数
    height(i)

全部评论
map函数可以对列表使用某个函数,就不用lambda了吧,感觉有点重复
点赞 回复 分享
发布于 2023-01-22 15:04 上海

相关推荐

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

创作者周榜

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