Python Program to get list size n and n elements of list, replace every elements with the greatest element located in right side. Input: 5 5 7 9 3 1 Output: 9 9 3 3 1

l=list(map(int,input("Enter numbers:").split(" "))) for i in range(0,len(l)-1): max1=l[i+1] for j in range(i+2,len(l)): if(l[j]>max1): ind=j max1=l[j] l[i]=l[ind] print(l)

visit each location in list find the greatest element (max1)next to the location using Store the max1 in current location by l[i] = max1

sum of list in python | without using built-in function

Average of list in python | without using built-in function

linear search in python

largest element in the list python | without using built-in function

smallest element in the list python | without using built-in function

Print all the numbers which are less than given key element from a given list.

delete element in list python

Revese the elements in list python

Reverse the first half of list elements in python

Reverse the second half of list elements in python

list sort python

list sort descending order python

Python Program to sort half of the list elements in ascending order and next half in descending order.

merging two lists in python

Python Program to replace every element with the greatest element on right side

circular list rotation in python

Copyright © 2017 by Decode School. click here to read our Privacy Policy