Vijaykrishna Ram

Vijaykrishna Ram

Python String find()

The Python string find() method is used to check if a string is a substring of another string. Often, when we want to check if a string contains another string, find() is very useful to solve this problem. Let us…

Python – Print to File

In this article, we shall look at some of the ways to use Python to print to file. Method 1: Print To File Using Write() We can directly write to the file using the built-in function write() that we learned…

Python struct Module

The Python struct module is used to provide a simple Pythonic interface to access and manipulate C’s structure datatype. This can be a handy tool if you ever need to deal with C code and don’t have the time to…

Python chr() and ord()

Python’s built-in function chr() is used for converting an Integer to a Character, while the function ord() is used to do the reverse, i.e, convert a Character to an Integer. Let’s take a quick look at both these functions and…

Python bytes()

Python bytes() is a built-in function which returns a bytes object that is an immutable sequence of integers in the range 0 <= x < 256. Depending on the type of object passed as the source, it initializes the byte…

Python String translate()

Python’s in-built method for the String class, str.translate(), is used to map a string with a translation table. The translate() method simply converts it using the translation table rules. Let’s understand more about the method in this article. Syntax of…