Found 27104 Articles for Server Side Programming

How to Create Checkbox in Kivymd-Python?

Pranay Arora
Updated on 18-Aug-2023 17:42:59

295 Views

Checkboxes are a type of graphical user interface (GUI) element. It enables users to select 1 or more options from a given set of choices. They are often represented in the form of small square boxes which can be either checked(selected) or unchecked(deselected). Checkboxes are normally in square shape and are on almost all forms on the internet depending upon the use case scenarios. The KivyMD framework of python is built on top of the Kivy library that allows developers to build cross-platform applications along with GUI’s. KivyMD consists of a large set of Material Design widgets which can ... Read More

How to Create Bottom Navigation using Kivymd and Python?

Pranay Arora
Updated on 18-Aug-2023 17:42:03

296 Views

KivyMD is a commonly known library of Python which offers us with a collection of Material Design (MD) compliant widgets. These widgets can be used along with the kivy framework which is another library and is used for creating multi-touch applications. The large number of UI elements that kivyMD provides us with, include buttons, cards, dialogs, menus and many more such elements, all of which are designed to give an appealing look and feel. A navigation bar is a UI element that allows users to “navigate” between different screens/sections of an application. They are normally present on the top ... Read More

Converting each list element to key-value pair in Python

Pranay Arora
Updated on 18-Aug-2023 17:40:55

198 Views

Lists are a commonly used data structure in python where data is stored in the form of elements. Key-value pairs are what we refer to as dictionaries where the data had unique keys and corresponding values. In this article, we are going to convert each list element into a key-value pair in Python. Converting each list element to a key-value pair in Python is done to efficiently organize and retrieve data by associating each element with a unique key. This transformation enhances data structure, enables faster lookup operations, and provides a flexible and meaningful representation of the data, improving readability ... Read More

Convert list to Single Dictionary Key Value list in Python

Pranay Arora
Updated on 18-Aug-2023 17:40:02

110 Views

Python is one of the most popular, high-level languages widely in use. Lists are one of the four built in data types in Python, used to store collections or groups of Data. Dictionary, Tuples and Sets are the other three data types. When working with Python, there are often situations where you have a list of values and you need to convert it into a single dictionary with key-value pairs. This article will guide you through the process of converting a list into a dictionary in Python. By the end, you will have a clear understanding of how ... Read More

Program to construct a DFA to check if a given integer is unsigned or not

Shubham Vora
Updated on 18-Aug-2023 18:13:39

145 Views

In this problem, we need to check whether the given number is an unsigned integer using the DFA. We need to construct the DFA using the 2D array to solve the problem. Problem statement – We have given string str of length N. By constructing the DFA, we need to check whether the str represents the unsigned integer. In the output, print ‘unsinged integer’ or ‘Not an unsinged integer’ according to whether the number is unsinged or not. Sample examples Input– str = "1729" Output– “Unsigned integer.” Explanation– As the number doesn’t contain any sign, it is an ... Read More

Python Program to check if two sentences can be made the same by rearranging the words

Shubham Vora
Updated on 18-Aug-2023 18:11:12

104 Views

In this problem, we need to check whether we can make two strings equal by rearranging the words of the string. We will learn three different approaches to solving the problem. In the first approach, we will use a dictionary. In the second approach, we will use the sort() method, and in the third approach, we will use the counter() constructor, which is used to count the hashable objects in the python. Problem statement – We have given a str1 and str2 containing sentences. We need to check whether we can make both strings equal by rearranging the words of ... Read More

Sort an array of strings by replacements with their GCD with elements from another array

Shubham Vora
Updated on 18-Aug-2023 17:39:34

52 Views

In this problem, we have given two arrays of strings. We need to replace array1’s values to sort array1. To replace the values of array1, we can take the GCD of the current string of array1 with any string of array2. The GCD of the string is very similar to the GCD of the number. To solve the problem, we can find a GCD string lexicographically larger than the GCD of the string at the ith index in array1 and the jth index in array2. Problem statement – We have given array1 and array2 containing the strings, and the length ... Read More

Modify characters of a string by adding integer values of same-indexed characters from another given string

Shubham Vora
Updated on 18-Aug-2023 17:38:30

100 Views

In this problem, we need to modify the given string by adding the value of the digit from the num string to the ASCII value of str’s character. To solve the problem, we can convert the digit character to the actual digit and add it to the ASCII value of the character. If the ASCII value becomes greater than 122, we start again from 97. Problem statement – We have given two strings of the same length equal to N. The first string, named str, contains the lowercase alphabetical characters, and the second string, named num, contains digits only. ... Read More

Modify array by removing characters from their Hexadecimal representations which are present in a given string

Shubham Vora
Updated on 18-Aug-2023 15:15:38

46 Views

We have given an array of positive integers and need to modify each element of the array by removing the characters given the ‘hex’ string from the hexadecimal representation of the current element. To solve the problem, we can convert the current number to a hexadecimal number. After that, we can remove the characters from the hexadecimal string, which are common in ‘hex’ and the current hexadecimal string. After modifying the hexadecimal string, we can convert it back to decimal. Problem statement – We have given an array containing positive integers, and the array's length is N. Also, we ... Read More

Modify a Binary String by flipping characters such that any pair of indices consisting of 1s are neither co-prime nor divisible by each other

Shubham Vora
Updated on 18-Aug-2023 15:14:22

89 Views

In this problem, we have given a binary string of length 4*N, and we need to flip zeros of the binary string so that any pair of indices containing ‘1’ should not be co-prime or divisible by each other. Here, we can solve the problem by observation. The string contains 4*N characters. We can flip the N characters from the last, which are at the even index. Problem statement – We have given an integer N and a binary string of the length 4*N containing all zeros initially. We need to flip ‘0’ to ‘1’ in such a way so ... Read More

Advertisements