IBM interview question

Simple list questions in python, query questions in sql