.pop()
Removes an item from a list while also returning it.
Syntax
list.pop(index)
It accepts one optional input which is the index of the element to remove. If no index is provided, then the last element in the list will be removed and returned.
Example
To pop the element 'Discrete Math'
from the courses
list:
Example 2
If no index is provided: