OfferUp Interview Question

Basic python program (specific to the interview, but generic in terms of coding) - and then optimize or show other ways the program could be written