Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Instead of if trip in GenTrips then else you can write if not trip in GenTrips then. Also, to see GenTrips after running this code, you can e.g. enter GenTrips; (or Length(GenTrips); if you want to inspect the length first).