Skip to main content

Featured

Best AI tools for students

Top 3 AI tools for Student  The biggest problem facing students in an information-rich environment is not access, but effective learning. A new generation of Artificial Intelligence (AI) tools is achieving previously unheard-of levels of efficiency, even while tools like interactive simulations and 3D models (like PhET or BioDigital) have made difficult subjects visual. AI is entering the classroom to help with anything from creating personalized study materials to giving prompt, focused feedback on tasks. AI is a co-pilot for the student trip, freeing up cognitive space for more in-depth critical thinking and creative work. We are getting past the basic calculator example. Here are some key AI resources that all students should be aware of and use in order to thrive in the contemporary world. 1. Human Bio Digital Explore the Inner Workings of the Human Body in 3D! Have you ever wished you could peel back the layers and truly see how your body—or a specific medical condition—actual...

Python Wikipedia

Intro

Python is high-level, general purpose programming language. By using python we can create different stuffs like dictionary, mobile application, web application, etc. By using python we can also search about any famous place, person, etc.  Like we search in wikipedia, we can get information about any famous places, person etc  from python by using wikipedia module.

Wikipedia in python is the library that makes it easy to access and parse data from Wikipedia.

Installation

For the installation of Wikipedia module , Python should be installed in your computer and pip as well. After this all you can open your command prompt or powershell and type

pip install wikipedia

Now Lets Write the program

import wikipedia

Search = input("type that you want to search") #here I want to search about Nepal
result = wikipedia.search(Search)
try:
  for sr in result:
    print(sr)
    print("-----------------------------------")
    print(wikipedia.page(sr).summary)
    print("******************************************")
    print()
except Exception as e:
  pass

You can also see the output in this link:  https://replit.com/@chandanshresth1/Cmd-Wikipedia#main.py

Lets see how above program is working

First of all we imported the wikipedia module then we asked the user what to search. Then we write result = wikipedia.search(Search). Here we are telling the wikipedia module to search about something we asked the user to type. After this we used the try and except because if there will any error it will not arrive during the program execution. In 4th line we wrote result = wikipedia.search(Search) this will return a list which contains the term related  to the user enter.  In for loop,  for every items in the list are being search in wikipedia and getting the summary of every items in list. Then the program will display the results.

Comments

Popular Posts