Write a function LShift(Arr,n) in Python, which accepts a list Arr of numbersand 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]
Answers
Answer:
n=3
plz make me as brainlest
Question:
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%.
https://brainly.in/question/25989972