python condition if list not empty