开发者

How to fill array missing elements? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in it开发者_开发百科s current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

I have a simple arrary:

a = [1,2,3,6,7,10,11,12,15,16]

How to fill array missing elements ?


range(min(a), max(a) + 1)
# [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜