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)
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)
精彩评论