Write a python function that deletes the last element of a list and returns the list and the deleted element


Topic: Write a python function that deletes the last element of a list and returns the list and the deleted element

Solution

def delete_last_element(list_to_be_processed):
    deleted_element = list_to_be_processed.pop()
    return list_to_be_processed, deleted_element



List all Python Programs