0
In the last project of the Python beginners course I am having an error in output " none ,'what should I do?
Expected output "word found' My output"word found None' Here is the code... def search (text ,word ): if word in text : k="Word found" if word not in text: k="Word not found" print (k) text = input() word = input() print(search(text, word))
2 odpowiedzi
+ 2
Your function does not return anything, so it returns None.
Either replace the 1st print() with return or remove the last print()
0
Thank you so much it worked