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

Questions & AnswersCategory: Programming LanguageWhat will be the output of the following Python program? def addItem(listParam): listParam += [1] mylist = [1, 2, 3, 4] addItem(mylist) print(len(mylist))
Geek Boy Staff asked 2 years ago

What will be the output of the following Python program?

def addItem(listParam):    
    listParam += [1]
    mylist = [1, 2, 3, 4]
addItem(mylist)
print(len(mylist))

a. 5
b. 8
c. 2
d. 1