TORONTO KIDS COMPUTER CLUB | PMCA Saturday 18:30 Python Homework 21.05.22.
19503
post-template-default,single,single-post,postid-19503,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

PMCA Saturday 18:30 Python Homework 21.05.22.

25 May PMCA Saturday 18:30 Python Homework 21.05.22.

Question:
Iven an list of words of strings made only from lowercase letters, return a list of all characters that are common in all the strings. Also, if the same character appears multiple times, then include that character only once.

Hint:
convert all the words in the list into a set and use either set.intersection or set.intersection_update to find all the common items.

Sample Execution 1:
Input
["bella", "label", "roller"]

Output
['e', 'l']

Explanation
In all the three strings in the list, only the characters e and l appear once

Sample Execution 2:
Input
['apple', 'orange', 'pineapple']

Output
['e']

Explanation
Only character e is common in all the words of the string
No Comments

Sorry, the comment form is closed at this time.