write a program to insert New value in the array (sorted list ).

 l1=list(map(int,input().split()))

ele=int(input())

for i in range(len(l1)):

    if ele<l1[i]:        

        break

l1.insert(i,ele)

print(l1)

No comments:

Post a Comment