Computer Science, asked by Gurpindersingh799, 1 year ago

The command used to add elements to a list

Answers

Answered by killer980gmailcom
1

Answer:

Let's look adding element to a list with an example

# fruit list

fruit = ['orange', 'apple', 'banana']

# an element is added

fruit.append('pineapple')

#Updated Fruit List

print('Updated fruit list: ', fruit)

output

Updated fruit list: ['orange', 'apple', 'banana', 'pineapple']

as you see , 'pineapple' element has been added as last element.

Similar questions