python print list if not empty