x=[1,2,4,5] missing_no=[] for i in range(x[0],x[-1]+1): if i not in x: missing_no.append(i) print(missing_no)
@sarithabhise27
Correct, keep it up.