
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10476 Articles for Python

5K+ Views
In this article, we will learn how to decode and encode hexadecimal digits using python. Methods Used Using binascii module Using the base64 module Method 1: Using Binascii Module There are several methods to convert between binary and different ASCII-encoded binary representations in the binascii module. Use the binascii module if all you need to do is encode or decode a raw string of hex digits. Algorithm (Steps) Following are the Algorithms/steps to be followed to perform the desired task. − Use the import keyword to import the binascii module. Create a variable to store the ... Read More

2K+ Views
In this article, we will learn a python program that prints out the decimal equivalents of 1/2, 1/3, 1/4, . . . ,1/10. Methods Used The following are the various methods to accomplish this task − Printing Decimal Equivalent of 1/2 Using the range() function Using the decimal module Method 1: Printing Decimal Equivalent of 1/2 We can easily use this code to find the decimal equivalents of 1/2. In this code, we just display the output after storing the result of 1/2 in a variable, inputNumber. Example The following program returns the decimal equivalents of 1/2 − ... Read More

3K+ Views
In this article, we will learn a python program to efficiently compute sums of diagonals of a matrix. Methos Used The following are the various methods to accomplish this task − Using Nested For Loops Using Only Single Loop In a matrix we have two diagonals − Principal diagonal Secondary diagonal Example Let us take a 3x3 matrix as shown below − A00 A01 A02 A10 A11 A12 A20 A21 A22 Principal Diagonal Condition − The row-column condition is row = column. The principal diagonal is formed by A00, A11, and ... Read More

443 Views
In this article, we will learn a python program to check if a matrix is lower triangular. Assume we have taken an input matrix. We will now check whether the input matrix is lower triangular using the below methods. Methos Used The following are the various methods to accomplish this task − Using nested for loop What is a Lower Triangular Matrix? If all the entries above the main/principal diagonal are zero, a square matrix is said to be lower triangular. Example 1 0 0 0 2 3 0 0 1 3 7 0 0 ... Read More

2K+ Views
In this article, we will learn a Python program to check if a number is a Perfect Square in a List. What is a Perfect Square? A perfect square is an integer that can be written as the square of another integer. It is referred to as the product of some integer with itself in other words. Example 25 = 5x5 Methods Used The following are the various methods to accomplish this task − Using List comprehension & math module Using For Loop & math module Using ** Operator Using the filter() and lambda functions The sqrt() ... Read More

3K+ Views
In this article, we will learn a python program to check if a matrix is symmetric. What is a Symmetric Matrix? If the transpose of a square matrix matches the original matrix, the matrix is said to be symmetric. By changing from row to column and from column to row, the symmetric matrix may be obtained. For Example 2 6 8 6 1 3 8 3 9 Assume we have taken an NxN input matrix. We will now check whether the matrix is symmetric or not using the below methods. Methos Used The following ... Read More

6K+ Views
In this article, we will learn a Python Program to calculate Profit Or Loss. The following are the different methods to accomplish this task − Using If Conditional Statements Using the abs() function. What are the selling price, cost price, and Profit and Loss? The price a consumer pays to purchase a product or a commodity is known as the selling price. It is a price that is higher than the cost price and also includes a portion of the profit. Cost price is the cost at which the seller buys the product or the commodity. He ... Read More

530 Views
In this article, we will learn how to break a Set into a list of sets in Python. Assume we have taken an input set. We will now break this input set into a list of sets element-wise using the below-mentioned methods. Methods Used The following are the various methods used to accomplish this task − Using For Loop and append(), add() functions Using Python map() & lambda functions Using List Comprehension Method 1: Using For Loop and append(), add() Functions Algorithm (Steps) Following are the Algorithms/steps to be followed to perform the desired task. − Create ... Read More

2K+ Views
In this article, we will learn how to add a data table to the figure using Python. Although matplotlib is primarily a plotting library, it also assists us with minor tasks when making a chart, such as having a nice data table alongside our attractive visuals. It is critical to understand why we are adding a table to a plot. The primary goal of plotting data visually is to clarify the otherwise incomprehensible (or barely understandable) data values. Now we want to add the data back in. It is not advisable to just put a large table with values beneath ... Read More

67K+ Views
In this article, we will learn how to add a character to a specific position in a string in Python. Methods Used The following are the various methods to accomplish this task − Using the '+' operator Using join() function Using format() function Method 1: Using the '+' operator We can concatenate strings and characters using the symbol "+" at the required positions. Adding Character at the End of a String Algorithm: Following are the Algorithms/steps to be followed to perform the desired task. − Create a variable to store an input string. Use the "+" operator ... Read More