Sarika Singh has Published 146 Articles

Python program to find the size of the largest subset of anagram words

Sarika Singh

Sarika Singh

Updated on 04-Apr-2023 11:59:46

546 Views

This article teaches you how to write a Python program to find the size of the largest subset of anagram words Every character of the rearranged string or number must also be a component of another string or number in order for the condition of an anagram to exist. To ... Read More

Python program to check for URL in a string

Sarika Singh

Sarika Singh

Updated on 04-Apr-2023 11:47:24

3K+ Views

This article will teach you how to determine whether a string contains a URL or not. In Python, strings are collections of bytes that represent Unicode characters. You can use single or double quotes and everything enclosed in them is considered as a string. When given a string, we will ... Read More

*args and **kwargs in Python

Sarika Singh

Sarika Singh

Updated on 04-Apr-2023 11:40:53

659 Views

When we define a function in a python program, the purpose is to execute the code again and again by supplying different values to the function's arguments. One challenge in this design is, what if we are not sure about the number of arguments we want to process each time ... Read More

Segregate 0’s and 1’s in an array list using Python?

Sarika Singh

Sarika Singh

Updated on 19-Dec-2022 12:06:22

1K+ Views

The elements in the contiguous memory address are contained in the linear data structure known as an array. At these places, it primarily groups components of the same data type. Given an array of integers. The array is to be divided into two halves, 0s and 1s, according to ... Read More

What is the meaning of single underscore prefix with Python variables?

Sarika Singh

Sarika Singh

Updated on 23-Nov-2022 08:33:34

5K+ Views

Python variable name may begin with a single underscore. It functions as a convention to indicate that the variable name is now a private variable. It should be viewed as an implementation detail that could change at any time. Programmers can assume that variables marked with a single underscore are ... Read More

What does double underscore prefix do in Python variables?

Sarika Singh

Sarika Singh

Updated on 23-Nov-2022 08:30:59

5K+ Views

When a double underscore is added as prefix to python variables the name mangling process is applied to a specific identifier(__var) In order to avoid naming conflicts with the subclasses, name mangling includes rewriting the attribute name. Example Following is the program to explain the double underscore in Python − ... Read More

Python Program to print unique values from a list

Sarika Singh

Sarika Singh

Updated on 23-Nov-2022 08:24:42

3K+ Views

List is a built-in data structure in python which functions like a dynamically sized array. Lists are created by putting elements in square brackets ‘[element 1, element 2, ….]’. Elements present in list are indexed and the indexing starts from [0]. List has the following properties − List is ... Read More

How to dynamically load a Python class?

Sarika Singh

Sarika Singh

Updated on 23-Nov-2022 08:22:09

5K+ Views

A class is a group of items. It is a logical entity with a few unique attributes and methods. For instance, if you have a class for Cricket, it should have an attribute and method like players, tournaments, toss, runs, wickets, matches, etc. Use the keyword ‘class’ to create a ... Read More

How do we handle circular dependency between Python classes?

Sarika Singh

Sarika Singh

Updated on 23-Nov-2022 08:18:22

5K+ Views

In this article we are going to discuss how to handle the circular dependency between Python classes. First of all, let us understand what is circular dependency. When two or more modules depend on one another, this is known as a circular dependency. This is because each module is defined ... Read More

How do I make a subclass from a super class in Python?

Sarika Singh

Sarika Singh

Updated on 23-Nov-2022 08:14:02

4K+ Views

In this article we are going to discuss how to create subclass from a super class in Python. Before proceeding further let us understand what is a class and a super class. A class is a user-defined template or prototype from which objects are made. Classes offer a way to ... Read More

Advertisements