Seaching in Wikipedia + Summary ↓↓↓

import wikipedia 
from IPython.display import display, Markdown  # For Jupyter Notebook

# Ask the user to type in a search term
search_term = input("Enter a term to search on Wikipedia: ")

# Search for a page related to the term
result = wikipedia.search(search_term)

# If we get a result, get the summary and display it
if result:
    summary = wikipedia.summary(result[0])  # Get the first result's summary
    print(search_term)  # Display the search term
    display(Markdown(summary))  # Display the summary in Jupyter Notebook
else:
    print("No results found.")

math

Mathematics is a field of study that discovers and organizes methods, theories and theorems that are developed and proved for the needs of empirical sciences and mathematics itself. There are many areas of mathematics, which include number theory (the study of numbers), algebra (the study of formulas and related structures), geometry (the study of shapes and spaces that contain them), analysis (the study of continuous changes), and set theory (presently used as a foundation for all mathematics). Mathematics involves the description and manipulation of abstract objects that consist of either abstractions from nature or—in modern mathematics—purely abstract entities that are stipulated to have certain properties, called axioms. Mathematics uses pure reason to prove properties of objects, a proof consisting of a succession of applications of deductive rules to already established results. These results include previously proved theorems, axioms, and—in case of abstraction from nature—some basic properties that are considered true starting points of the theory under consideration. Mathematics is essential in the natural sciences, engineering, medicine, finance, computer science, and the social sciences. Although mathematics is extensively used for modeling phenomena, the fundamental truths of mathematics are independent of any scientific experimentation. Some areas of mathematics, such as statistics and game theory, are developed in close correlation with their applications and are often grouped under applied mathematics. Other areas are developed independently from any application (and are therefore called pure mathematics) but often later find practical applications. Historically, the concept of a proof and its associated mathematical rigour first appeared in Greek mathematics, most notably in Euclid’s Elements. Since its beginning, mathematics was primarily divided into geometry and arithmetic (the manipulation of natural numbers and fractions), until the 16th and 17th centuries, when algebra and infinitesimal calculus were introduced as new fields. Since then, the interaction between mathematical innovations and scientific discoveries has led to a correlated increase in the development of both. At the end of the 19th century, the foundational crisis of mathematics led to the systematization of the axiomatic method, which heralded a dramatic increase in the number of mathematical areas and their fields of application. The contemporary Mathematics Subject Classification lists more than sixty first-level areas of mathematics.

Adding emoji to the articles ↓↓↓

from newspaper import Article
from emoji import emojize
from IPython.display import display, Markdown

# Set the URL of the article we want to read
url = "http://cnn.com/2023/03/29/entertainment/the-mandalorian-episode-5-recap/index.html"

# Create an article object and download its content
article = Article(url)
article.download()  # Get the article data from the web
article.parse()  # Read the text of the article

# Add some fun emojis to the article title
emoji_title = emojize(":newspaper: ") + article.title + emojize(" :thumbs_up:")

# Display the title with emojis and the article text in Jupyter Notebook
display(Markdown(f"### {emoji_title}"))
display(Markdown(article.text))

📰 ‘The Mandalorian’ finally comes into focus, while giving out a ‘Rebels’ yell 👍

Editor’s Note: The following contains spoilers about the fifth episode of “The Mandalorian,” Season 3, “The Pirate.”

CNN —

After what can at best be described as a somewhat disjointed third season thus far, the fifth episode of “The Mandalorian” began to bring those pieces together and into focus, while continuing to draw upon the “Star Wars” animated series that preceded it, including another cameo by a character from the rightfully lauded “Rebels.”

Subtitled “The Pirate,” the episode presented further evidence of the dysfunctional nature of the New Republic, unable or unwilling to defend a faraway planet from an invading band of pirates. (Lucasfilm being a unit of Disney, the marauders had a certain “Yo ho, yo ho” vibe to them.)

The siege also played into Mandalorian politics, and the efforts of Bo-Katan (Katee Sackhoff) to reclaim her heritage and potentially reunite her people’s various tribes, after leading them, along with Din Djarin (voiced by Pedro Pascal), to the rescue of his pal Greef Karga (Carl Weathers) and the planet’s residents.

Still, the most pleasing moment for longtime “Star Wars” fans was likely what amounted to a throwaway scene, introducing a live-action version of the hulking alien Zeb, a character from the animated “Star Wars Rebels,” which concluded in 2018. “The Mandalorian” has drawn heavily from those properties, which were overseen by one of its executive producers, Dave Filoni. (In another nice touch, Steve Blum again provided the voice of the character, and Zeb looked a whole lot better than the pirate leader.)

Finally, the episode closed with evidence that the evil Moff Gideon (played by Giancarlo Esposito previously) had seemingly been freed from the prison ship that was transporting him to stand trial, reviving that potential threat.

Having resolved the fate of Grogu, a.k.a. Baby Yoda, during the first two seasons, “The Mandalorian” has thus moved on to fill in narrative gaps about an under-explored chapter in “Star Wars” history – namely, the factors that resulted in the fall of the New Republic and the rise of the First Order, the plot line featured in the most recent trilogy that began with “The Force Awakens.”

“This isn’t a rebellion anymore,” a bureaucrat (played by Tim Meadows) says about what happens outside of the New Republic’s jurisdiction, conveying an indifference to the fate of the planet Nevarro overtly articulated later when it was observed that the governing body in Coruscant “doesn’t care.”

Executive producers Jon Favreau and Filoni have taken their time in reaching this point, juggling these various issues in somewhat ungainly fashion through the first half of the season. That perhaps reflects the transition of the show to an emphasis on the macro instead of the micro, while still finding time to detour for the occasional “Rebels” yell.

Statistics ↓↓↓

import statistics as stats

# List of some numbers (like test scores)
data = [99, 345, 11, 44, 88, 66, 77, 112]

# Find the average (mean) of the numbers
mean = stats.mean(data)

# Find the middle value (median) of the numbers
median = stats.median(data)

# Find how spread out the numbers are (standard deviation)
stdev = stats.stdev(data)

# Show the results
print(f"Average (Mean): {mean}")
print(f"Middle value (Median): {median}")
print(f"How spread out (Standard Deviation): {stdev}")

Average (Mean): 105.25
Middle value (Median): 82.5
How spread out (Standard Deviation): 102.00525196562886