Motive There are different types of modules in python which not everyone knows so we thought of introducing them to you guys. Let's start! Note: This is not a tutorial of how to use these but is to show that these modules also exist and if you want to know more you can visit there own page and if you want us to explain leave a comment below. Links to there page are also given below. Hope you found something useful. 1.Wikipedia Yes, there is a module called Wikipedia in python, you can easily install Wikipedia by pip install wikipedia . We cannot rely on this module for advanced use. It was designed for ease of use and simplicity. Learn More Here . Here is a simple example: import wikipedia wikiPython = wikipedia.summary("Python", sentences=2) print(wikiPython) One big disadvantage is that it works only if the internet is connected to your device. You can even control the number of sentences that you
Motive
I just want to show you guys about the new library
for getting the number of people with COVID and those who have recovered from the
whole world or from a specific country. I wish this could be useful for you
guys.
The Project
As I said
this Library can be used for getting the number of people with COVID and those
who have recovered from the whole world or from a specific country. So let's
begin! As always installing the library is the first thing we should do. So
open up ur terminal and type pip install covid and hit enter and let it download. According to there documentation, it
says that the library works on python 3.6 or above.
Let's find
the things that we can do with the library before that open your preferred
IDE and import the library with from covid import Covid and
covid = Covid()
With
covid.get_total_active_cases() as the
name suggests, we can get the total number of active cases in the whole world,
with covid.get_total_deaths() we can get the
total number of deaths in the whole world and with
covid.get_total_confirmed_cases() we can get
the total number of confirmed cases in the whole world. Now just Print what you want!
There are some other useful lines of code also as the others just give you the status of the whole world what if you wanted to get the number of a specific country, for that you can use covid.get_status_by_country_name('countryName'), this is with the help of the country name you can even get it with the country ID, for that we can use covid.get_status_by_country_id('countryId') now you may be wondering how can I get the country id, for that you can use covid.list_countries() this will give you the id and the country name.
If you have any doubts or errors in the program feel free to comment down below and I will respond as early as possible. And if I have made any mistake please correct me in the comment box below. Don't forget to follow us for such python related content.
Comments
Post a Comment