I want to create a list with elements appearing only once. Here's what I've tried.
years_of_birth = years_of_birth = [1990, 1991, 1990, 1990, 1992, 1991]
ages = []
for year in years_of_birth:
ages.append(2022 - year)
print(ages)
unique_ages = []
for age in ages:
if operator.countOf(1, age):
print(unique_ages)