Examveda

What will be the output of the following Python code?
def increment_items(L, increment):
    i = 0
    while i < len(L):
        L[i] = L[i] + increment
        i = i + 1
 
values = [1, 2, 3]
print(increment_items(values, 2))
print(values)

A. None
[3, 4, 5]

B. None
[1, 2, 3]

C. [3, 4, 5]
[1, 2, 3]

D. [3, 4, 5]
None

Answer: Option A


This Question Belongs to Python Program >> Lists In Python

Join The Discussion

Related Questions on Lists in Python