A quick way to return list without a specific element in Python

suits = ["h","c", "d", "s"]

noclubs = [x for x in suits if x != "c"]

Leave a Comment