Write a function common_characters
that takes two strings (str
). The function must return the number of characters (int
) both strings have in common. Each character is counted only once: the strings bee
and tween
only have one character in common (the letter e
). Uppercase and lowercase letters are considered to be different characters.
>>> common_characters('bee', 'tween')
1