Question: def get_name_compatibility(name1: str, name2: str) -> float: Return the name compatibility between `name1` and `name2`, which is the number of letters from `name1` that

def get_name_compatibility(name1: str, name2: str) -> float: """ Return the name compatibility between `name1` and `name2`, which is the number of letters from `name1` that appear in `name2` plus the number of letters from `name2` that appear in `name1`, divided by the total number of letters in both names together, all multiplied by 100.

>>> get_name_compatibility('BOB Y', 'BOBBETTE ZE') 50.0

>>> get_name_compatibility('BOB Y123', 'bob y!') 100.0

>>> get_name_compatibility('Alice', 'Alyssa') 45.45454545454545 """

# TODO: design and write the function body

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!