题解 | #生成数字列表#

生成数字列表

https://www.nowcoder.com/practice/2d836a1b27a2401eb338eee62953bd43

list2 = []
list1 = input().split()
for i in list1:
    list2.append(int(i))

print(list2)
# list推导式
list1 = [int(i) for i in input().split()]
print(list1)

推导式详解:https://www.runoob.com/python3/python-comprehensions.html

全部评论

相关推荐

有没有佬投这个呀,怎么样呀求问
投递中科院空天信息创新研究院等公司10个岗位
点赞 评论 收藏
分享
07-07 17:06
已编辑
深圳技术大学 golang
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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