Answer to Question #192297 in Python for LEROY

Question #192297


   

def novel_or_knockoff(name, off_brand):

 # novel_or_knockoff() 

  

 # @type: 

 # @rtype: 

 count = 0

 for index in range(0,len(name)):

  if name[index] != off_brand[index]:

   count = count + 1

 if count >= 3:

  return "Novelty"

  

 else:

  return "Knockoff"

# Example: if Playstation [index] != playstation [index] :

     count = count + 1

     if count >= 3:

      return "Novelty"

     else;

      return "Knokoff"




1
Expert's answer
2021-05-12T04:00:04-0400
def novel_or_knockoff(name, off_brand):


	count = 0
	for index in range(len(name)):
		if name[index] != off_brand[index]:
			count += 1
		if count = 3:
			return "Novelty"
	return "Knockoff"

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