What will be the output of the following Python code?
veggies = ['carrot', 'broccoli', 'potato', 'asparagus']
veggies.insert(veggies.index('broccoli'), 'celery')
print(veggies)
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
Join The Discussion