#create a new list from an existing one that only keeps long words (>3 letters) words = 'My cat is black and I like her.'.split() long_words = [word for word in words if len(word) > 3] #how many long words are there? sum([1 for word in words if len(word) > 3]) len([5 for word in words if len(word) > 3]) #len(long_words) [(thing to keep) for variable in list {if condition is True}] #without if clause new_list = [] for variable in list: new_list.append(thing to keep) #with if clause new_list = [] for variable in list: if condition is True: new_list.append(thing to keep) [val*val for val in range(1, 6)] new_list = [] for val in range(1, 6): new_list.append(val*val)