InterviewSolution
| 1. |
Write a function LShift(Arr,n) in Python, which accepts a list Arr of numbers and n is a numeric value by which all elements of the list are shifted to left. Sample Input Data of the list Arr= [ 10,20,30,40,12,11], n=2 Output Arr = [30,40,12,11,10,20] |
|
Answer» n:Write a function LShift(Arr,n) in Python, which ACCEPTS a list Arr of numbers and n is a numeric value by which all ELEMENTS of the list are shifted to left. Sample Input DATA of the list Arr= [ 10,20,30,40,12,11], n=2 Output Arr = [30,40,12,11,10,20]Solution:def LShift(Arr,n): L=len(Arr) for x in range(0,n): y=Arr[0] for i in range(0,L-1): Arr[i]=Arr[i+1] Arr[L-1]=y print(Arr)LearnMore on Brainly.in:A binary file “STUDENT.DAT” has structure (admission_number, Name, Percentage). Write a function countrec() in Python that would read contents of the file “STUDENT.DAT” and display the details of those STUDENTS whose percentage is above 75. Also display NUMBER of students scoring above 75%.brainly.in/question/25989972 |
|