
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 33676 Articles for Programming

271 Views
A faulty calculator in Python is a calculator that gives incorrect results for certain calculations. In Python, we can create our own calculator and use it for doing mathematical calculations. If we want to create a faulty calculator we need to create or introduce errors in the functions that perform the calculations. In this article, we will create a faulty calculator using Python. Creating a faulty Calculator Creating a faulty calculator is easy as we need to just introduce some incorrect calculations in the normal calculator in the code to give an incorrect result which converts it into a ... Read More

2K+ Views
In Python, we can replace a word in Excel with another word using a third-party Python library called openpyxl. Microsoft Excel is a useful tool that is used for managing and analyzing data. Using Python we can automate some of the Excel data management tasks. In this article, we will understand how we can replace a word in Excel using Python. Installing openpyxl Before implementing the program to replace Word in Excel we need to install the openpyxl library in our system using the Python package manager. To install openpyxl type the following command on your terminal or command ... Read More

4K+ Views
In this article, the given task is to find the number of unique words in a text file. In this Python article, using two different examples, the approaches to finding the unique words in a text file and their count are given. In the first example, given words from a text file are fetched, and then their unique set is made before counting these unique words. In example 2, first the list of words is created, then it is sorted. After this from this sorted list, the duplicates are removed and finally, the unique word left in the file ... Read More

198 Views
In this Python article, the given task is to get the frequency of the elements which are common in a list of strings. Sometimes the list to be analyzed using Python is available in an Excel file. To get this list from Excel, a module called openpyxl is used. In this Python article, using three different examples, the ways of getting the frequency of the items which are repeated in a list of strings are given. In example 1, the frequency of the characters which are common in a list of strings is found. In the next two examples, ... Read More

1K+ Views
In this article, the given task is to add the first and the last digit of an integer. Now the integer can be very small or it can be a big number. So, these programs will have two parts. First, we need to find how big the integer is and then get the first digit from it. The second part will be to get the last number from the given integer which can be done easily by dividing the number by ten and finding the remainder. In this Python article, using four different examples, the approaches to adding the first ... Read More

586 Views
In this article, the task is to print the positive numbers from a list of integers. Here, in this Python article, this task is done using the different methods in 4 different examples. Then these positive numbers are printed. In example 1, the positive numbers are picked and separated into another list. In the example 2, all the elements that are not positive are removed. In example 3, the sorted list is split up to zero and only positives are retained. In example 4, filter is used to select the positive numbers. Example 1 - Select only the positive numbers ... Read More

486 Views
Many times we see two files that look similar but had certain differences. If the files are big or have lots of content, searching for that difference or finding the uniqueness in that file manually is not easy. However, this problem of finding the unique lines in two text files can be done easily using Python programs. In this article, using three different examples, three different ways of finding the unique lines in two text files are given. The text files used are a.txt and b.txt while in the end the result is stored in another txt file. For these ... Read More

328 Views
Sometimes, we require starting index of a word and also the last index of that word. A sentence is made up of words that are separated by spaces. In this Python article, using two different examples, the two different ways of finding the beginning and ending indices of all words in a sentence or a given string, are given. In the first example, the process of simple iteration through all the characters of a string is followed while finding the spaces to mark the beginning of words. In example 2, a Natural Language Toolkit is used for the task of ... Read More

200 Views
A number is said to be an Armstrong number if the digits are taken individually and raised to the power of the total digits and then these subparts are added together and they give the number itself. Here, in this Python example, using two different examples, the method of finding the total sum of n-digit Armstrong numbers is given. In example 1, the method to calculate the sum of all the 3 digit Armstrong numbers is given. In example 2, the number of digits can be decided by the user at runtime. This program is tested using digit values 4 ... Read More

769 Views
Sometimes the task is to separate the negative and positive numbers or to separate the odd numbers and even numbers from a list of integers. Here, in this Python article, both these tasks are done. First negative numbers are separated into another list. Then the positive odd and positive even numbers are separated into separate lists. To calculate the sum, the numbers from these negative number lists, positive odd number lists, and positive even number lists are taken to calculate sums separately. In the two different examples, the main list of integers is formed. In example 1, the negative and ... Read More