Write a function LShift(Arr) in Python, which accepts a list Arr of numbers and replaces each even
value with two times of its value
Answers
Answered by
0
nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
def LShift(Arr):
for i, v in enumerate(Arr):
if v % 2 == 0:
nums[i] = 2 * v
return Arr
print(LShift(nums))
Similar questions