Examveda

What will be the output of the following Python code?
veggies = ['carrot', 'broccoli', 'potato', 'asparagus']
veggies.insert(veggies.index('broccoli'), 'celery')
print(veggies)

A. ['carrot', 'celery', 'broccoli', 'potato', 'asparagus'] Correct 1.00

B. ['carrot', 'celery', 'potato', 'asparagus']

C. ['carrot', 'broccoli', 'celery', 'potato', 'asparagus']

D. ['celery', 'carrot', 'broccoli', 'potato', 'asparagus']

Answer: Option A


This Question Belongs to Python Program >> Lists In Python

Join The Discussion

Related Questions on Lists in Python