Imagine you have a list of students and their grades for an exam:
students = [["Jane", "B"], ["Kate", "B"], ["Alex", "C"], ["Elsa", "A"], ["Max", "B"], ["Chris", "A"]]
Select only students with the best grade ("A") and print their names in a list. Do all this in one line. We have already created the students variable with other names and grades.
You can create and print a list in one line if you start directly with
print([#your condition here]).