
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
Server Side Programming Articles - Page 2287 of 2651

335 Views
Most developers know about python, irrespective of what python is implemented in their system. Therefore, what do I mean by “python”, is it a python the abstract interface? Do we mean CPython, the common Python implementation (not the Cython)?. Or we mean something else entirely? Or we mean Jython or IronPython or PyPy. While the technologies mentioned above are commonly-named and commonly-referenced, however some of them serve completely different purposes. We can think of python as a specification for a language that can be implemented in many different ways. In this tutorial we’ll go through the following implementation of python ... Read More

1K+ Views
Python is a very versatile language as it provides huge set of libraries to work on different requirements. We all work on Portable Document Format (PDF) files. Python provides different ways to work with pdf files. In this we are going to use python library called PyPDF2 to work with pdf file.PyPDF2 is a pure-python PDF library capable of splitting, merging together, cropping, and transforming the pages of PDF files. It can also add custom data, viewing options, and passwords to PDF files. It can retrieve text and metadata from PDFs as well as merge entire files together.As we can ... Read More

580 Views
This might seem very useful for a lazy python programmer who keeps most of the files and folders at one location and sometimes at confused what all files are there and surely he is too lazy to do it manually. So below is a python program to organize or simplify everything in appropriate folder in the single go and remove empty directories.So we have a directory path where lots of files of different types are present (like below) and our program we segregate each file type into their respective folders (like below).Input folder structureDesired OutputFirst create different folders based on ... Read More

4K+ Views
In this section we are going to see the type of image file we have. So consider a situation, where in a directory we have hundreds of image file and we want to get all the jgeg(or any particular image file type) file type. All this we are going to do programmatically using python.Python provide library to determine the type of an image, on such library is imghdr.The python imghdr package determines the type of image contained in a file or byte stream.InstallationThere is a very much chances that if you are using python 3.6 or higher, imghdr module is ... Read More

888 Views
In this section we are going to develop a command line interface using python. But before we deep dive into program, lets first understand command line.Command line are in use since the existence of computer programs and are built on commands. A command line program is a program that runs from a shell or from a command lineWhile command line interface provides user interface that is navigated by typing commands at terminals, shells or consoles instead of using the mouse.A command-line interface(CLI) starts with an executable. There are parameters which we can pass to the script depending how they are ... Read More

397 Views
Logistic Regression is a statistical technique to predict the binary outcome. It’s not a new thing as it is currently being applied in areas ranging from finance to medicine to criminology and other social sciences.In this section we are going to develop logistic regression using python, though you can implement same using other languages like R.InstallationWe’re going to use below libraries in our example program, Numpy: To define the numerical array and matrixPandas: To handle and operate on dataStatsmodels: To handle parameter estimation & statistical testingPylab: To generate plotsYou can install above libraries using pip by running below command in ... Read More

623 Views
Hangman is a classic word game in which participants needs to guess as many secret words as you can before time runs out! So, it’s a nice game to learn new words, one letter at a time!So we are going to write python script for this classic game “hangman”.#importing the time module import time #welcoming the user name = input("What is your name? ") print("Hello, " + name, "Time to play hangman!") print ("") #wait for 1 second time.sleep(1) print ("Start guessing...") time.sleep(0.5) #here we set the secret word= ("Secret") word = word.lower() ... Read More

2K+ Views
Any number which can be expressed as a quotient or fraction in the form of p/q is called a rational number. The fractions module of Python library provides functionality for rational number arithmetic.This module defines a Fraction class. Its object can be constituted in various ways as below −Fraction(num, denom)The first version of Fraction constructor receives two parameters for numerator and denominator. Default numerator is 0 and default denominator is 1. Value of denominator = 0 throws ZeroDivisionError.>>> from fractions import Fraction >>> n1 = Fraction(2, 5) >>> n1 Fraction(2, 5) >>> n2 = Fraction(6, 15) >>> n2 Fraction(2, 5) ... Read More

581 Views
The statistics module of Python library consists of functions to calculate statistical formulae using numeric data types including Fraction and Decimal types.Following import statement is needed to use functions described in this article.>>> from statistics import *Following functions calculate the central tendency of sample data.mean() − This function calculates the arithmetic mean of data in the form of sequence or iterator.>>> from statistics import mean >>> numbers = [12, 34, 21, 7, 56] >>> mean(numbers) 26The sample data may contain Decimal object or Fraction object>>> from decimal import Decimal >>> numbers = [12, 34, 21, Decimal('7'), 56] >>> mean(numbers) Decimal('26') ... Read More

7K+ Views
Here we will see how to print leading zeros as output in C++. We know that if we directly put some zeros before some numeric values, then all zeros are discarded, and only exact numbers are printed.Printing Leading Zeros with C++ Output Operator We can manipulate the output sequence in C++ by utilizing the iomanip header. In this header, we have two manipulators, setw() and setfill(). The setw() function is used to create space between the previous text and the current text, and then we use setfill(char) to add characters to that field. Example of Printing Leading Zeros In this ... Read More