Question: 8 + X 0 [ ]: C Code V Validate 15.lpynb X + Task 3 Next, write a fruitful function unique chars (mylist) that calculates
8 + X 0 [ ]: C Code V Validate 15.lpynb X + Task 3 Next, write a fruitful function unique chars (mylist) that calculates the number of distinct characters appearing in a list should only be counted once). We have seen (at least) two ways to do this in our lecture notes. One way involves using the set data structure. Duplicates are forbidden in set s, which is convenient for this task. If we c called e.g. usedchars every time we encounter a new word, then the size of the final set will be the number of distinct cha list. 1. Check that unique chars (["red", "green", "blue"]) returns 8 as it should
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
