Sarika Singh has Published 72 Articles

How to append elements in Python tuple?

Sarika Singh

Sarika Singh

Updated on 22-Aug-2023 01:47:41

114K+ Views

Tuples in Python are immutable, meaning that once they are created, their contents cannot be changed. However, there are situations when we want to change the existing tuple, in which case we must make a new tuple using only the changed elements from the original tuple. Following is the example ... Read More

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

208 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

2K+ 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

232 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

What is an anonymous function in Python?

Sarika Singh

Sarika Singh

Updated on 19-Dec-2022 12:35:50

18K+ Views

An anonymous function in Python is one that has no name when it is defined. In Python, the lambda keyword is used to define anonymous functions rather than the def keyword, which is used for normal functions. As a result, lambda functions are another name for anonymous functions. Syntax Following ... Read More

The return Statement in Python

Sarika Singh

Sarika Singh

Updated on 19-Dec-2022 12:09:39

2K+ Views

The return statement in python is an extremely useful statement used to return the flow of program from the function to the function caller. The keyword return is used to write the return statement. Since everything in python is an object the return value can be any object such as ... 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

How variable scope works in Python function?

Sarika Singh

Sarika Singh

Updated on 19-Dec-2022 12:01:30

208 Views

In this article we will discuss about how a variable scope works in Python function. The scope of a name is the area of a program in which you can clearly access a name, such as variables. Hence, a variable scope is the region in which we can access ... Read More

How to use *args and **kwargs in Python?

Sarika Singh

Sarika Singh

Updated on 19-Dec-2022 11:57:47

1K+ Views

In this article we will discuss about *args and **kwargs properties and their usage in Python. To pass unspecified number of arguments to a function usually *args and **kwargs properties are used. The *args property is used to send a non-keyword variable length argument to a function call whereas ... 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

4K+ 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

Advertisements