how to print all but the last item in a list in python code example Example: python remove last element from list record = record[:-1]