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
1
Explanation:
hope it helps............
Attachments:
Answered by
3
Answer:
def LShift(Arr, n):
for x in range(0,n):
ele = Arr.pop(0)
Arr.append(ele)
print(Arr)
Explanation:
Similar questions
Math,
2 months ago
English,
2 months ago
Chemistry,
5 months ago
English,
11 months ago
Accountancy,
11 months ago