Category Archives: Python Programming

Python Program to Check Prime Number

Here you will get python program to check prime number. A number is called prime number if it is only divisible by 1 or itself. For example 2, 3, 5, 7, 11, etc are prime numbers. Below program takes a number as input and checks it is prime number or not. Python Program to Check… Read More »

Python Program to Check Leap Year

Here you will get python program to check leap year. A normal year contains 366 days while a leap year contains 365 years. If the year is divisible by 4 then it is leap year except the century years (year that have 00 in end). A century year is leap year only if it is… Read More »

Python Program to Find Largest Among Three Numbers

Here you will get python program to find largest number among three numbers. The program will ask user to input three numbers and then print greatest among them.

Output enter three numbers: 12 7 9 12 is largest

Python Program to Swap Two Numbers

Here you will get python program to swap two numbers with and without using temporary variable. Python Program to Swap Two Numbers Using Temporary Variable

Output before swapping a= 10 b= 20 after swapping a= 20 b= 10 Python Program to Swap Two Numbers Without Using Temporary Variable Method 1: Python provides a way… Read More »

Python Program to Add Two Numbers

Here you will get python program to add two numbers. The program will first ask user to enter two numbers, calculate their sum and finally print it. input() is an inbuilt function which is used to take input from user. Python Program to Add Two Numbers

Output enter first number:5 enter second number:7 sum:… Read More »

Python GUI Programming (Tkinter) – Part II

In previous Python GUI programming tutorial we discussed about how we can create a GUI window using Tkinter module. I have also shared an example of how you can use a Label widget. In this Python tutorial we will discuss some more GUI widgets. For installation of Tkinter and introduction of Python GUI programming read… Read More »

Python GUI Programming (Tkinter) – Part I

In this Python GUI programming tutorial you will learn about how to make GUI programs using Python Tkinter toolkit. Graphical User Interface, also known as GUI is one of the best features in programming that makes a program look visually more attractive than the normal text based programs covered with a black or any other… Read More »

Python Object Oriented Programming – Class and Object

In this tutorial we will discuss about Python Object Oriented Programming (OOP), class, object and constructor with some program examples. Python is one of the few programming languages which supports both Structured Programming feature as well as Object Oriented Programming approach at the same time. So, in a single program we can have an OOP… Read More »

Python Exception Handling

In this tutorial you will learn about Python exception handling, try, catch and finally block. Program code is developed by humans and therefore it is about to be wrong sometimes. It may happen that our code consists of errors such as run-time error, syntax error, semantic errors and many others. It is important for Python… Read More »

Python File Handling

In this tutorial we will discuss about Python file handling concepts. The tutorial will include opening file, closing file, reading from and writing to file. Text files are a great way to store information. The normal text files stores data in the least possible memory size, generally in Kilobytes. Text Files are extremely easy to… Read More »