Python

Scrap a webpage site title using Python

Scrap a webpage site title using Python   Description: To scrap a webpage title first we need to have some libraries installed. Libraries like ‘request’ and ‘BeautifulSoup’ can be used to scrap the title. Implementation: import requests from bs4 import BeautifukSoup def get_webpage_title(url): try: response = requests.get(url) response.raise_for_status() soup = BeautifulSoup(response.content, ‘html.parser’) title = soup,title.string …

Scrap a webpage site title using Python Read More »

Create an English to Spanish language translator using Python

Text translation is becoming increasingly important in a growing digital space like the internet. With users from multiple nationalities accessing online websites, it’s essential to create globally readable content. This involves the task of language translation. Using Python, we can build a language translator to accomplish this goal. In this tutorial, we will understand 2 …

Create an English to Spanish language translator using Python Read More »

How to print the calendar of any year in Python using Tkinter

To create a Graphical User Interface (GUI) calendar, where users can input their year of choice, press enter, and obtain a calendar for each month of the year, we can make use of multiple GUI packages. One of the easiest to use is the ‘tkinter’ package available in Python. The packages used in this tutorial …

How to print the calendar of any year in Python using Tkinter Read More »

How to return a function as a return value in Python

Python return statement: A return statement is used to end the execution of the function call and “returns” the result (value of the expression following the return keyword) to the caller. The statements after the return statement is without any expression, then the special value None is returned. A return statement is overall used to invoke a …

How to return a function as a return value in Python Read More »

How to pass a function as an argument in Python

Passing function as an argument in Python: A function can take multiple arguments can be objects, variables(of same or different data types) and functions. Python functions are first class objects. In the example below, a function is assigned to a variable. This assignment doesn’t call the function. It takes the function object referenced by shout …

How to pass a function as an argument in Python Read More »

Scroll to Top