Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def inputL(a,size):
- index=0
- while index < size:
- print("a[",index,"]=")
- elem = float(input())
- a.insert(index,elem)
- index+=1
- def Wkl(a,size):
- for i in range(0,size):
- x = float(a[i])
- j = i -1
- while (j >= 0 and x < a[j]):
- a[j+1]=a[j]
- j-=1
- a[j+1]=x
- def outPut(a):
- for i in range(0,len(a)):
- print("a[",i,"]=",a[i])
- def main():
- print("Enter the number of elements: ")
- n = int(input())
- a=[]
- inputL(a,n)
- Wkl(a,n)
- outPut(a)
- main()
Advertisement
Add Comment
Please, Sign In to add comment