0
I have problem with indent , how to resolve?
text = input('entrer texte') word = input('entrer word') def search(text , word): i = 0 for letter in word: if word in text: i += 1 return i return "Word found" else: return "Word not found" print(search(text, word))
5 ответов
+ 1
text = input('entrer texte')
word = input('entrer word')
def search(text , word):
    i = 0
    for letter in word:
        if word in text:
          i += 1
          print("Word found")
    return i
          '''
          it is not possible to use return twice in a single if block, read more about return statement!
         ''' 
          else:
             return "Word not found"
print(search(text, word))
+ 1
0
I need to count numbers of words that same in text
0



