PROBLEM 3 (12 pts) – Number of distinct elements in a list Write a function which receives as input a list of numbers an
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
PROBLEM 3 (12 pts) – Number of distinct elements in a list Write a function which receives as input a list of numbers an
PROBLEM 3 (12 pts) – Number of distinct elements in a list Write a function which receives as input a list of numbers and returns as result the number of distinct values in the list (so if a value appears more than once in the list, it is counted only once). def numberOfDistinctValues (someList): Some examples: numberOfDistinctValues ([8,12,4,3,5,8,5]) --> 5 numberOfDistinctValues ([7,3,9,3,0,7,3]) --> 4
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!