Home » Python » Page 3


Exiting/Terminating Python Scripts (Simple Examples)

Today, we’ll be diving into the topic of exiting/terminating Python scripts! Before we get started, you should have a basic understanding of what Python is and some basic knowledge about its use. You can use the IDE of your choice, but I’ll use  Microsoft’s Linux Subsystem for Windows (WSL) package this time. For more information on that and how you ...

Read More »

20+ Examples For NumPy Matrix Multiplication

In this tutorial, we will look at various ways of performing matrix multiplication using NumPy arrays. we will learn how to multiply matrices with different sizes together. Also. we will learn how to speed up the multiplication process using GPU and other hot topics, so let’s get started! Before we move ahead, it is better to review some basic terminologies of ...

Read More »

Caesar Cipher In Python (Text Encryption Tutorial)

Cryptography deals with encrypting or encoding a piece of information (in a plain text) into a form that looks gibberish and makes little sense in ordinary language.This encoded message(also called ciphertext) can then be decoded back into a plain text by the intended recipient using a decoding technique (often along with a private key) communicated to the end-user. Caesar Cipher is ...

Read More »

NumPy Loadtxt Tutorial (Load Data From Files)

In a previous tutorial, we talked about NumPy arrays and we saw how it makes the process of reading, parsing and performing operations on numeric data a cakewalk. In this tutorial, we will discuss the NumPy loadtxt method that is used to parse data from text files and store them in an n-dimensional NumPy array. Then we can perform all sorts of ...

Read More »

20+ Examples For Flattening Lists In Python

Flattening lists means converting a multidimensional or nested list into a one-dimensional list. For example, the process of converting this [[1,2], [3,4]] list to [1,2,3,4] is called flattening. The process of flattening is very easy as we’ll see. You will learn how to flatten different shapes of lists with different techniques. So, let’s jump in A list of lists Let’s ...

Read More »

How to Convert a String to Lowercase in Python

As this series grows, I’ve started poking at seemingly simple problems to expose their complexity. This time, I thought it would be interesting to look at how to convert a string to lowercase. As it turns out, there’s a really straightforward solution (lower()), but I think it’s worth looking at a few homemade solutions first. For instance, we could try ...

Read More »