Python Program to find missing number in array

arr = [10,3,2,4,6,5,7,9,1]
missing_element = []
for i in range(1,(len(arr)+1)):
if i not in arr:
missing_element.append(i)
print(" The Missing element is:",missing_element)

@mick4mayank
Correct, keep it up.

1 Like