Question about the difference between pop() and del keyword(python)

Is my understanding correct?
pop() remove and return the last item in the list, so it can be used to implement “First In Last Out” structure
by pop(), and “First In First Out” structure by pop(0)

del can also be used to delete specified index’s item.

So, my question is what’s the difference between those two. If those two are the same,
why would Python creator bother to create both? Is there only difference that pop() returns the
remove item while del does not?

The difference is that pop() returns the removed element, whereas del() simply removes it. Both can be used to remove a value at a specific index, pop() just has the added behavior of defaulting to the last index unless an index is provided as argument.

Example:

    In [1]: list_to_pop_from = [1, 3, 6]
    In [2]: list_to_delete_from = [4, 2, 7]
    In [3]: popped_value = list_to_pop_from.pop(1)
    In [4]: popped_value
    Out[4]: 3
    In [5]: del(list_to_delete_from[2])
    In [6]: list_to_pop_from
    Out[6]: [1, 6]
    In [7]: list_to_delete_from
    Out[7]: [4, 2]
1 Like
>>> popped = [1, 2, 3, 4, 5]
>>> deleted = [1, 2, 3, 4, 5, 6]
>>>
>>> popping = popped.pop(0)
>>> deleting = del(deleted[0])
  File "<stdin>", line 1
    deleting = del(deleted[0])
                 ^
SyntaxError: invalid syntax
>>> del(deleted[0])
>>> popped
[2, 3, 4, 5]
>>> deleted
[2, 3, 4, 5, 6]
>>> popping
1
>>> del... huh??? whaaa?????
  File "<stdin>", line 1
    del... huh??? whaaa?????
             ^
SyntaxError: invalid syntax
>>>

Yes, one more thing added.
del can remove slices while pop() cannot