Latest Posts From Vijaykrishna Ram

Python Complex

How to Use the Python complex() method

The Python complex() method is used to create a complex number from other primitive data-types. This is useful whenever you want to perform complex arithmetic and transformations quickly. Let’s take a look at how we can use this method. Syntax of Python complex() This function returns a complex number, which contains a real part, and […]

Python String Contains

Python String contains()

In this article, we’ll take a look at finding whether one Python string contains another string. How can we easily do it? Python has a built-in string method String.__contains__(), which we can use easily. Let’s look at how we can use this method. Syntax of String.__contains__() This function will take two strings, and return if […]

Python Append List

Append to a List in Python

In this article, we’ll take a look at how we can append to a List in Python. Python’s list.append() provides the solution to this, so we’ll see some examples using this method. Let’s get started! Append to a normal List in Python We can use Python’s built-in append() method on our List, and add our […]

Python Randint

Generate random integers using Python randint()

In this article, we’ll take a look at generating random integers using the Python randint() method. This method is in the random module in Python, which we will use to generate pseudo-random numbers, so we’ll need to import it to load this method. Let’s take a look at this method now! Syntax of Python randint() […]

Python Sort Dictionary

How to Sort a Dictionary in Python?

There are different ways through which we can sort a Dictionary in Python. There are many ways, depending on whether you want to sort it by key or by value. Let’s take a look at some of them in the article! Sort a Dictionary in Python by Value If we want to sort a Dictionary […]

Python String Casefold

Python String casefold()

The Python String casefold() method returns a case folded string, and we use this to remove all case distinctions in a string. Let’s look at what this means. Using the Python String casefold() method This belongs to the String class, and can be used only on String objects. The Syntax for this method is: This […]