The Reduce Function in Python 3: Simply Explained

? The reduce() function from Python’s functools module aggregates an iterable to a single element. It repeatedly merges two iterable elements into a single one as defined in the function argument. By repeating this, only a single element will remain — the return value. Minimal Example Here’s the minimal example: The code performs the following steps: … Read more

101+ Free Python Books

Free Python Book

Books remain great learning devices — even in the age of AI. But why spending money when you can get them for free? This article compiles a list of 101++ FREE Python books to destroy any excuse of not learning Python. Everyone can afford to read free books! Also check out my two other free … Read more

How to Convert a String List to an Integer List in Python

The most Pythonic way to convert a list of strings to a list of ints is to use the list comprehension [int(x) for x in strings]. It iterates over all elements in the list and converts each list element x to an integer value using the int(x) built-in function. This article shows you the simplest … Read more

How to Convert a String List to a Float List in Python

The most Pythonic way to convert a list of strings to a list of floats is to use the list comprehension floats = [float(x) for x in strings]. It iterates over all elements in the list and converts each list element x to a float value using the float(x) built-in function. This article shows you … Read more

How to Convert an Integer List to a Float List in Python

The most Pythonic way to convert a list of integers ints to a list of floats is to use the list comprehension expression floats = [float(x) for x in ints]. It iterates over all elements in the list ints using list comprehension and converts each list element x to a float value using the float(x) … Read more

Striving for Collective Intelligence

The idea I’m going to tell you is well-researched but little-known. And it’s meta. Thinking about it has become my main passion, life mission, and purpose. It’s how I see the world. In short: what drives me is increasing collective intelligence. Collective Intelligence is Everywhere You are not one individual but many individual cells that are … Read more

How to Get an HTML Page from a URL in Python?

This tutorial shows you how to perform simple HTTP get requests to get an HTML page from a given URL in Python! Problem Formulation Given a URL as a string. How to extract the HTML from the given URL and store the result in a Python string variable? Example: Say, you want to accomplish the … Read more