Blog

python tutorials and learn python

Created with Sketch.

Python program to delete a node from the end of the Circular Linked List

Python program to delete a node from the end of the Circular Linked List In this program, we will create a circular linked list and delete a node from the end of the list. If the list is empty, it will display the message “List is empty”. If the list is not empty, we will…
Read more

Python program to delete a node from the beginning of the Circular Linked List

Python program to delete a node from the beginning of the Circular Linked List In this program, we will create a circular linked list and delete a node from the beginning of the list. If the list is empty, print the message “List is empty”. If the list is not empty, we will make the…
Read more

Python program to create and display a Circular Linked List

Python program to create and display a Circular Linked List In this program, we will create a circular linked list and print all the nodes present in the list. Circular Linked List: The circular linked list is a kind of linked list. First thing first, the node is an element of the list, and it…
Read more

Python program to create a Circular Linked List of n nodes and display it in reverse order

Python program to create a Circular Linked List of n nodes and display it in reverse order In this program, we create a circular linked list, then traverse the list in the reverse order and print the nodes. ALGORITHM: Define a Node class which represents a node in the list. It has two properties data…
Read more

Python program to create a Circular Linked List of N nodes and count the number of nodes

Python program to create a Circular Linked List of N nodes and count the number of nodes In this program, we have to find out the number of nodes present in the circular linked list. We first create the circular linked list, then traverse through the list and increment variable ‘count’ by 1. ALGORITHM: Define…
Read more

Python program to print all pronic numbers between 1 and 100

Python program to print all pronic numbers between 1 and 100 The pronic number is a product of two consecutive integers of the form: n(n+1). For example: 6 = 2(2+1)= n(n+1), 72 =8(8+1) = n(n+1) Some pronic numbers are: 0, 2, 6, 12, 20, 30, 42, 56 etc. In this program, we need to print…
Read more

Python program to determine whether the given number is a Harshad Number.

Python program to determine whether the given number is a Harshad Number. If a number is divisible by the sum of its digits, then it will be known as a Harshad Number. For example: The number 156 is divisible by the sum (12) of its digits (1, 5, 6 ). Some Harshad numbers are 8,…
Read more

Python program to print all happy numbers between 1 and 100

Python Program to Print Happy Numbers Between 1 and 100 Introduction In this blog post, we will explore and implement a Python program to print all Happy Numbers within the range of 1 to 100. Happy Numbers are a fascinating mathematical concept that involves a sequence of operations on the digits of a number. We…
Read more

Python program to check if the given number is Happy Number

Python program to check if the given number is Happy Number A number is said to be happy if it yields 1 when replaced by the sum of squares of its digits repeatedly. If this process results in an endless cycle of numbers containing 4, then the number will be an unhappy number. Let’s understand…
Read more

Python program to print all disarium numbers between 1 and 100

Introduction In this blog post, we will explore a Python program that identifies and prints all Disarium numbers within the range of 1 to 100. Disarium numbers are those whose sum of each digit, each raised to the power of its respective position, equals the number itself. Python Program   Program Explanation The program defines…
Read more