开发者

How to fill array missing elements? [closed]

开发者 https://www.devze.com 2023-03-29 06:18 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in it开发者_开发百科s current form.
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

精彩评论

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