When in run my python script, i get the following result:
Try again
None
import wikipedia
import time
def wiki_search(word):
try:
wikipedia.set_lang("es")
wiki_result = wikipedia.summary(word, sentences=1, auto_suggest=True, redirect=True)
return wiki_result
except wikipedia.exceptions.WikipediaException as e:
return translate(e)
def translate(text):
if "match" in str(text):
print "Try again"
else:
print text
print wiki_search("Mark Zuckerb")
time.sleep(5)
Why "None" appear and how to remove it from the output?