Write the definition of a function Alter(A, N) in python, which should change all the multiples of 5 in the list to 5 and rest of the elements as 0. #sol def Alter ( A, N): for i in range(N): if(A[i]%5==0): A[i]=5 else: A[i]=0 print("LIst after Alteration", A) d=[10,14,15,21] print("Original list",d) r=len(d) Alter(d,r) ''' OUTPUT Original list [10, 14, 15, 21] LIst after Alteration [5, 0, 5, 0] ''' #-------------------------------------- Write the definition of a function Alter(A, N) in python, which should change all the odd numbers in the list to 1 and even numbers as 0. #sol def Alter ( A, N): for i in range(N): if(A[i]%2==0): A[i]=0 else: A[i]=1 print("LIst after Alteration", A) d=[10,13,15,21] print("Original list",d) r=len(d) Alter(d,r) ''' output Original list [10, 13, 15, 21] LIst after Alteration [0, 1, 1, 1] ''' #------------------------------------------------------------------- Write code for a function void oddEven (s, N) in python, to add 5 in all the odd values and 10 in all the even values of the list 5. #sol def oddEven ( s, N): for i in range(N): if(s[i]%2==0): s[i]=s[i]+5 else: s[i]=s[i]+10 print("LIst after Alteration", s) d=[10,13,15,21] print("Original list",d) r=len(d) oddEven(d,r) ''' output Original list [10, 13, 15, 21] LIst after Alteration [15, 23, 25, 31] ''' #-------------------------------------------------------------------------- Write a code in python for a function void Convert ( T, N) , which repositions all the elements of array by shifting each of them to next position and shifting last element to first position. e.g. if the content of array is 0 1 2 3 10 14 11 21 The changed array content will be: 0 1 2 3 21 10 14 11 sol: def Convert ( T, N): for i in range(N): t=T[N-1] T[N-1]=T[i] T[i]=t print(T) d=[10,14,11,21] r=len(d) Convert(d,r) #--------------------------------------- ''' Write a code in python for a function Convert ( T, N) , which repositions all the elements of array by shifting each of them to next position and shifting first element to last position. e.g. if the content of array is 0 1 2 3 10 14 11 21 The changed array content will be: 0 1 2 3 14 11 21 10 ''' def Convert ( T, N): t=T[0] for i in range(N-1): T[i]=T[i+1] T[N-1]=t print("after conversion",T) d=[10,14,11,21] print("Original List",d) r=len(d) Convert(d,r) ''' output Original List [10, 14, 11, 21] after conversion [14, 11, 21, 10] ''' #-------------------------------------------------------------------- Write a function SWAP2BEST ( ARR, Size) in python to modify the content of the list in such a way that the elements, which are multiples of 10 swap with the value present in the very next position in the list sol : def SWAP2BEST(A,size): i=0 while(i