Answer to Question #192432 in Python for LEROY

Question #192432

One day someone tells Pierre that there is a sweet shop across the street named

"Olivier and Bhalla's Store for Something Sweet". This was very frustrating. Pierre

contacted the authorities about the knockoff right away. The government ruled that if

the name of a knockoff brand has more than 3 different letters than the original

companies name, they are considered a novelty and are allowed to continue operating.

If the name of the knockoff company is within 3 (inclusive) letters of the original

companies name, then they are labelled as a knock off and should be closed down.

Create a function that takes two different company names, and returns wether or not

the imposter company is a Novelty, or a Knockoff.


my function dosent work pls help me with an example wat the final function looks like:




1
Expert's answer
2021-05-14T18:21:24-0400
def func(s1, s2):
    if len(set(s1) - set(s2)) <= 3:
        return 'Knockoff'
    return 'Novelty'

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS