SaiKrishna Tavva has Published 107 Articles

Pass by reference vs value in Python

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 20-Nov-2024 17:40:48

10K+ Views

In Python Call by Value and Call by Reference are two types of generic methods to pass parameters to a function. In the Call-by-value method, the original value cannot be changed, whereas in Call-by-reference, the original value can bechanged. Call by Value in Python When we pass an argument to a function, it ... Read More

Python Grayscaling of Images using OpenCV

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 13-Nov-2024 14:29:19

4K+ Views

Grayscaling an image includes converting a color image into a grayscale image. By using OpenCV library in various methods we can convert the color image with (multiple color channels) into a grayscale image (with a single channel). Some of the common methods for greyscaling an image using OpenCV are ... Read More

Longest Substring Without Repeating Characters in Python

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 13-Nov-2024 14:25:57

7K+ Views

In Python, by using different methods we can find the longest substring without repeating characters, such as by using the Brute force approach which involves checking all the Substrings, and also by using the advanced Sliding window Two Pointer approach, which uses a Hashmap to store the indexes. Some Common Methods Some ... Read More

How to format a floating number to fixed width in Python?

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 13-Nov-2024 13:50:54

6K+ Views

In Python formatting a floating point number to a fixed width can be done by using methods like Python's f-strings and the flexible format() method. Float formatting methods The two built-in float formatting methods are as follows ... Read More

__init_subclass__ in Python

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 13-Nov-2024 13:49:50

3K+ Views

In Python __init_subclass__ method is a special method that allows us to initialize or customization of class creation particularly for subclasses. Key Characteristics of __init_subclass__ Some of the Key aspects of '__init_subclass__' method are as follows ... Read More

How to create a directory using Python?

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 13-Nov-2024 12:58:54

634 Views

In Python the os module provides two methods for creating a directory they are os.mkdir() and os.makedirs(), we can create a Single directory by using os.mkdir() method and by using the os.makedirs() method we can create Subdirectories. To use those two methods, we need to include the os module, which ... Read More

How to use FTP in Python?

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 13-Nov-2024 12:47:27

474 Views

In Python we can use FTP (File Transfer Protocol) by importing the ftplib module, it will provide a simple interface to access FTP servers to retrieve files and process them locally. ftplib module allows us to write Python programs that perform a variety of automated FTP tasks. Objectives of FTP The ... Read More

Generate Captcha using Python

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 13-Nov-2024 12:05:27

2K+ Views

A modified version of the PIL called pillow library can be used to generate a text-based CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) in Python Imaging Library. Types of CAPTCHA There are different types of CAPTCHA and some of them are follows below. ... Read More

Private Methods in Python

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 17-Oct-2024 13:05:14

2K+ Views

In object-oriented programming,  private methods are functions that act as access modifier within a class designed only for internal use and not accessible from outside the class. The functionality of private methods is primarily meant for encapsulation which means that they are hidden to prevent unwanted modifications and misuse. Working ... Read More

How to Sort CSV by multiple columns in Python ?

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 17-Oct-2024 12:52:51

9K+ Views

In Python, to sort a CSV file by multiple columns, we can use the 'sort_values()' Method provided by the Python Pandas library. This method is used for sorting the values by taking column names as arguments. Some of the common methods for sorting a CSV file by multiple columns are as follows. ... Read More

Advertisements