The following list is given: artists = ['Sting', 'Phil Collins', 'The Police', 'Queen', 'AC/DC'] The following operation was performed on the list: artists.pop() Select artists list after this operation.

Questions & AnswersCategory: PythonThe following list is given: artists = ['Sting', 'Phil Collins', 'The Police', 'Queen', 'AC/DC'] The following operation was performed on the list: artists.pop() Select artists list after this operation.
Lokesh Kumar Staff asked 2 years ago

The following list is given:

artists = ['Sting', 'Phil Collins', 'The Police', 'Queen', 'AC/DC']

The following operation was performed on the list:

artists.pop()

Select artists list after this operation.
a. [‘Sting’, ‘Phil Collins’, ‘The Police’, ‘Queen’]
b. [‘Phil Collins’, ‘The Police’, ‘Queen’, ‘AC/DC’]
c. [‘Sting’, ‘Phil Collins’, ‘The Police’, ‘Queen’, ‘AC/DC’]
d. []

1 Answers
Lokesh Kumar Staff answered 2 years ago

a. [‘Sting’, ‘Phil Collins’, ‘The Police’, ‘Queen’]
 
Explanation:

list.pop([i]) – remove the item at the given position in the list, and return it. If no index is specified, a.pop() removes and returns the last item in the list.