names = ["Alex", "Beth", "Caroline", "Dave", "Elanor", "Freddie"]
new_list = [name.upper() for name in names if len(name) > 5]
print(new_list)

8cf4be1869ec0eed20297d3e3ab737a9858c5093
<mask token>

<mask token>
print(new_list)

names = ['Alex', 'Beth', 'Caroline', 'Dave', 'Elanor', 'Freddie']
new_list = [name.upper() for name in names if len(name) > 5]
print(new_list)

names = ["Alex", "Beth", "Caroline", "Dave", "Elanor", "Freddie"]
new_list = [name.upper() for name in names if len(name) > 5]
print(new_list)
