Ramesh and suresh started doing fun activity in which ramesh writes down the word and tell suresh the number of letters in his word. Then suresh tries to guess the word that ramesh had written. After suresh guesses the word they both compare the words to determine the minimum number of letters suresh has to replace his guessed word becomes an anagram of ramesh word.
Note: suresh and ramesh words are same length
Input line contains two space seperated strings
Output must be in single line representing minimum number of letters to be replaced
Input: honey moon
Output: 1
Input: ccbp pbcc
Output: 0
Need correct output sir
words = input("Enter 2 words of the same length (separate spase)").split()
number_same_letter = 0
for letter in words[1]:
if letter in words[0]:
number_same_letter += 1
print("Answer: ", len(words[0]) - number_same_letter)
Comments
Leave a comment