Page 1 of 1

## Question 6: first_duplicate function (8 marks) Write a function called first_duplicate that takes a list as an argume

Posted: Tue May 24, 2022 8:39 am
by answerhappygod
## Question 6: first_duplicate function (8 marks) Write a
function called first_duplicate that takes a list as an argument
and returns the first element that is duplicated in the list. If no
duplicates are found, the function should return None. Hint: One
way of doing this is to use the count method to see how many
instances of each element there are. If there is more than 1, it
means that that element is duplicated. Write code to test the
function first_duplicate with a list of numbers and a list of
tuples. If your function does not work with both types, then change
it until it does work with these two types.