Category Archives: Program

Python Program to Find the Sum of Natural Numbers

Here in this article, we have provided a python program that can find the sum of n natural numbers using Python loop. Prerequisite topics to create this Program Python Input, Output Python if…else statement Python Data types Python Operators Python Loop Steps First, we ask the user to enter a number n. Using the int() function we will… Read More »

Python Program to Check Armstrong Number

In this python program, we will ask the user to enter a number and as an output, the program will tell if the entered number is an Armstrong number or not. Armstrong Number: A number is said to be Armstrong’s number if the sum of that number each digit which is raised to the power of total digits… Read More »

Python Program to Print the Fibonacci sequence

In this python program, we will ask the user to enter a positive integer value and print that many numbers from the Fibonacci sequence. Fibonacci Sequence The Fibonacci sequence can either start from 0 or 1, and each next value in the series is the sum of the previous two numbers, for example, 0,1,1,2,3,5,8,…. is a Fibonacci series.… Read More »

Python Program to Display the Multiplication Table

Here we have provided a python program that asks the user to enter a number and its multiplication table. Prerequisite topics to create this program Python Input, Output Python Data types Python Type Conversion Python For loop Python Arithmetic Operator Steps First, we will ask the user to enter a number Using the int() function we will convert… Read More »

Python Program to Find the Factorial of a Number

In this python tutorial, you will learn how to write a Python program to calculate the factorial of a number. Prerequisite topics to create this program. Python Input, Output Python Data types Python Type Conversion Python For loop Python if…else Python Arithmetic Operator Steps First, we will ask the user to enter a number Using the int() function… Read More »

Python Program to Check Prime Number

In this python tutorial, you will learn how to write a python program to check if a number is Prime or not. Prerequisite topics to create this program. Python Input, Output Python nested if…else statement Python Data types Python Type Conversion Python For loop Python break statement Python Arithmetic Operator Note:  1 is not a prime number prime… Read More »

Python Program to find Hash of File

In this article, we have provided a python source code that can find the hash of a file and display it Prerequisite topics to create this program. Python Functions Python user-defined functions Python Modules Python hashlib library Python File I/O A hash function accepts the data and returns a fixed-length bit string. Hash functions mostly used in cryptography… Read More »

Python Program to Find the Size (Resolution) of Image

Here in this article, we have provided two different python source codes which can find the resolution of a jpeg image. Prerequisite topics to create this program. Python Function Python File handling. Python PIL library Python user-defined function Python file I/O Find the Size (Resolution) of a JPEG Image Without any External Library: Code: def image_resolution(filename): # open… Read More »