Found 33676 Articles for Programming

Why JavaScript is Used in Blockchain?

Kalyan Mishra
Updated on 14-Jul-2023 16:59:58

322 Views

In this article, you will learn about the use of JavaScript in blockchain technology. We will get to know the reason for using JavaScript in the blockchain Furthermore we will also know about twins' language. JavaScript is a dynamically typed language which perform type checking of language at runtime. JavaScript may not be perfectly accurate but still it is widely used in the blockchain development due to its versatility, popularity, and ease of use. One reason why JavaScript is used in blockchain and makes it a twin language is its ability to run on both the client-side and server-side, which ... Read More

Solving the First Law of Thermodynamics using Python

Dr Pankaj Dumka
Updated on 14-Apr-2023 13:44:43

1K+ Views

The first law of thermodynamics is related to energy conservation, i.e., if energy in form disappears then the energy will in appear in some other form. In thermodynamics majorly we are concerned about heat, work and internal energy. Heat and work are the form of energy which are also called as "energy in transit", hence they are path functions. They cannot be stored by a system, whereas internal energy is the property of the system which can be stored by system. For a closed system, the first law is written as − $$\mathrm{\Sigma Q=\Sigma W}$$ But this is only valid ... Read More

Python Program to Differentiate String == operator and__eq__() method

Rohan Singh
Updated on 17-Apr-2023 10:30:38

292 Views

In Python, the comparison operator (==) and equals() methods are used in different ways when working with strings. To differentiate between the == operator and the equals method in Python we have to use them with string comparison. String comparison widely occurs when we work with strings in data analysis and machine learning. In this article, we will see how we can differentiate between the == operator and the equals() method when used with strings. == operator in Python The == is a comparison operator used to compare two string values. It returns True when the value of the string ... Read More

Python Program to demonstrate the string interpolation

Rohan Singh
Updated on 17-Apr-2023 10:29:01

240 Views

In Python, we can demonstrate string interpolation using the f-string, %operator, and format() method. String Interpolation is the process of inserting dynamic data or variables in the string. It is useful when a string is formed using variables or expressions without using any string formatting or string concatenation. In this article, we will see how we can use Python to do string interpolation. Method 1 : Using f-string An f-string is a string literal which starts with f or F. The prefix f or F indicates that the string is an f-string. The string contains the expression which is enclosed ... Read More

Python Program to create a String object

Rohan Singh
Updated on 17-Apr-2023 10:27:45

1K+ Views

In Python, we can create a string object using Python's inbuilt function str() and also by assigning a sequence of characters to a variable. The sequence of characters is enclosed in the single quote or double quotes. We can also create a multiline string object using triple quotes. In this article, we look at the various ways in which we can create a string object in Python. Example 1:Creating a string object using single quote We can create a string object by simply assigning a sequence of characters enclosed in a single quote to a variable. my_string = 'Hello World!' ... Read More

Python Program to compare two strings by ignoring case

Rohan Singh
Updated on 17-Apr-2023 10:13:59

10K+ Views

In python we can use the comparison operators like “==”, ”!=”, “”, ”=” and python inbuilt function like lower() and upper() methods to compare two strings by ignoring case. Strings are character sequences enclosed in double quotes. These operators compare strings based on the Unicode code points assigned to each character of the string. In this article, we will understand how we can compare two strings by ignoring cases of the string. Comparing Strings Ignoring Case To compare two strings in Python while ignoring the case, we can use the lower() or upper() function which converts the string to ... Read More

Python Program to Clear the String Buffer

Rohan Singh
Updated on 17-Apr-2023 10:12:53

4K+ Views

In Python, we can clear the string buffer by assigning an empty string to the buffer and using Python's inbuilt reset() method. A string buffer is a mutable sequence of characters. These characters can be modified according to the requirements. The string buffer can be modified or cleared before the string is written to an output stream. In this article, we will understand how to clear the string buffer using examples. Method 1 : Assign Empty String to the Buffer One of the methods to clear the string buffer is to assign the buffer with an empty string. Assigning an ... Read More

Python Program to Check if a string is a valid shuffle of two distinct strings

Rohan Singh
Updated on 17-Apr-2023 10:11:07

529 Views

In Python, we can use inbuilt functions like len() and logic to check the sequence of the characters in the resultant string to know if a string is a valid shuffle of two distinct strings. A valid shuffle of two distinct strings means that a string is formed by mixing the characters of two distinct strings while maintaining the order of the characters of the two original strings. Python provides various inbuilt functions to play with strings. In this article, we will check if the string formed by shuffling the characters of two distinct strings is a valid string or ... Read More

Swift Program to Implement Binary Search Algorithm

Ankita Saini
Updated on 13-Apr-2023 11:43:30

2K+ Views

In swift, Binary search algorithm is used to search element from the sorted array. It repeatedly divides the search interval into half and then search the specified element. In the binary search algorithm, the input array must be in sorted order to reduce the time complexity. Algorithm Step 1 − Create a function to implement a binary search algorithm. Step 2 − Inside the function, first we find the lower bound and upper bound range of the given array. Step 3 − Run a while loop till LBound

Active product sales analysis using matplotlib in Python

Rohan Singh
Updated on 17-Apr-2023 09:46:31

2K+ Views

Matplotlib in Python has various functions like read_csv, sort_values, group_by, etc to perform sales data analysis. Every online business which is involved in product sales of any type uses product sales data analysis to increase their sales and know their customers better. Any company which is involved in any type of e-commerce business uses its sales and customer data to identify trends, patterns, and insights that can be used to improve sales and revenue. The sales data can be used to determine which product has the highest traction, which festive season has the highest demand, and many other trends which ... Read More

Advertisements