开发者

Python - Quick Integer List Creation

Can I make a list of numbers from开发者_JS百科 1 to 6 in one line without a loop?

goal:

[1,2,3,4,5,6]


Yes, use:

range(1,7)

that should do it.


Use the range builtin.

range(1, 7)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜