题解 | #生成数字列表#

生成数字列表

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

全部评论

相关推荐

12-20 11:21
复旦大学 Java
点赞 评论 收藏
分享
SaviorSu:直接说下学期可以请假,一般情况学校允许我26届,大三就直接去实习了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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