Category: Other

python tutorials and learn python

Created with Sketch.

Python program that finds the maximum and minimum value node from a circular linked list:

Python program that finds the maximum and minimum value node from a circular linked list: In this example, we first define a Node class with a constructor that initializes the data and next properties. The CircularLinkedList class is implemented using the Node class. The CircularLinkedList class has an append method that adds new data to…
Read more

Python program that deletes a node from the middle of a circular linked list, given a specific value:

Python program that deletes a node from the middle of a circular linked list, given a specific value: In this example, we first define a Node class with a constructor that initializes the data and next properties. The CircularLinkedList class is implemented using the Node class. The CircularLinkedList class has an append method that adds…
Read more

Python program that deletes a node from the end of a circular linked list:

Python program that deletes a node from the end of a circular linked list: In this example, we first define a Node class with a constructor that initializes the data and next properties. The CircularLinkedList class is implemented using the Node class. The CircularLinkedList class has an append method that adds new data to the…
Read more

Python program that deletes a node from the beginning of a circular linked list:

Python program that deletes a node from the beginning of a circular linked list: In this example, we first define a Node class with a constructor that initializes the data and next properties. The CircularLinkedList class is implemented using the Node class. The CircularLinkedList class has an append method that adds new data to the…
Read more

Python program that creates a circular linked list and displays its elements:

Python program that creates a circular linked list and displays its elements: In this example, we first define a Node class with a constructor that initializes the data and next properties. The CircularLinkedList class is implemented using the Node class. The CircularLinkedList class has an append method that adds new data to the end of…
Read more

Python program that creates a circular linked list of n nodes and displays it in reverse order:

Python program that creates a circular linked list of n nodes and displays it in reverse order: In this example, we first define a Node class with a constructor that initializes the data and next properties. The CircularLinkedList class is implemented using the Node class. The CircularLinkedList class has an append method that adds new…
Read more

Python program that creates a circular linked list of N nodes and counts the number of nodes:

A circular linked list is a type of linked list where the last node points to the first node, forming a circular loop. Here is a Python program that creates a circular linked list of N nodes and counts the number of nodes in the list: In this example, we first define a Node class…
Read more

Python program that uses a for loop and an if statement to print all pronic numbers between 1 and 100:

A pronic number is a number that is the product of two consecutive integers. For example, the number 6 is a pronic number because it is the product of 2 and 3 (2 x 3 = 6). Here is a Python program that uses a for loop and an if statement to print all pronic…
Read more

Python program that uses the modulus operator and the sum() function to check if a given number is a Harshad number

Python program that uses the modulus operator and the sum() function to check if a given number is a Harshad number The function is_harshad(n) takes an integer as an argument, it uses the str(n) method to convert the number to a string, and then the split() method to split the string into a list of…
Read more

Python program that uses a for loop and the is_happy() function to print all happy numbers between 1 and 100:

Python program that uses a for loop and the is_happy() function to print all happy numbers between 1 and 100: This program uses a for loop to iterate over the range 1 to 100, and for each number, it checks if it is a happy number by calling the is_happy(n) function. If the function returns…
Read more