Computer Science, asked by johnhopkins, 5 months ago

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]
Note : Since the value of n is 2, the elements of the list are shifted to the left two times

#Help needed, stuck with dis one!

Answers

Answered by monicasuresh4
1

Explanation:

hope it helps............

Attachments:
Answered by himanshubasra10
3

Answer:

def LShift(Arr, n):

  for x in range(0,n):

      ele = Arr.pop(0)

      Arr.append(ele)

  print(Arr)

Explanation:

Similar questions