adplus-dvertising
frame-decoration

Question

What will be the output?
def addItem(listParam):
    listParam += [1]
 
mylist = [1, 2, 3, 4]
addItem(mylist)
print(len(mylist))

a.

1

b.

4

c.

5

d.

8

Posted under Lists in Python Python

Answer: (c).5

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output?