Sep-16-2022, 08:10 PM
21 appears twice in the population. There are two elements in the population that just happen to have the same value. random.choices() does not eliminate duplicates, it prevents selecting the same element more than once.
If you want to eliminate duplicates in the population you can use set()
If you want to eliminate duplicates in the population you can use set()