Asim Husain
Results
1
comments of
Asim Husain
import wikipedia wikipedia.set_lang("en") topic = input("Enter a topic: ").strip() try: print("\nSummary:\n", wikipedia.summary(topic, sentences=3)) print("\nRelated articles:", ", ".join(wikipedia.search(topic)[:5])) except wikipedia.exceptions.DisambiguationError as e: print("Multiple options:", ", ".join(e.options[:5])) except wikipedia.exceptions.PageError: print("Page not found!")