Python Articles

Page 75 of 855

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

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 232 Views

When it is required to create a circular linked list and display it in the reverse order, a 'Node' class needs to be created.To display the data elements in the circular list in reverse order, another method can be defined, that would reverse the data. In this class, there are two attributes, the data that is present in the node, and the access to the next node of the linked list. In a circular linked list, the head and the rear are adjacent to each other. They are connected to form a circle, and don't have 'NULL' value in the ...

Read More

Python program to create and display a Circular Linked List

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 832 Views

When it is required to create a circular linked list and display it, a 'Node' class needs to be created. In this class, there are two attributes, the data that is present in the node, and the access to the next node of the linked list. In a circular linked list, the head and the rear are adjacent to each other. They are connected to form a circle, and don't have 'NULL' value in the last node.Another 'linked_list' class needs to be created that would have an initialization function, and the head of the node would be initialized to 'None'. Below ...

Read More

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

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 427 Views

When it is required to delete a node from the end of a circular linked list, a 'Node' class needs to be created. In this class, there are two attributes, the data that is present in the node, and the access to the next node of the linked list.In a circular linked list, the head and the rear are adjacent to each other. They are connected to form a circle, and don't have 'NULL' value in the last node.Another 'linked_list' class needs to be created that would have an initialization function, and the head of the node would be initialized ...

Read More

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

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 269 Views

When it is required to delete a node from the middle of the circular linked list, a 'Node' class needs to be created. In this class, there are two attributes, the data that is present in the node, and the access to the next node of the linked list.In a circular linked list, the head and the rear are adjacent to each other. They are connected to form a circle, and don't have 'NULL' value in the last node.Another class needs to be created that would have an initialization function, and the head of the node would be initialized to ...

Read More

Python program to find the maximum and minimum value node from a circular linked list

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 382 Views

When it is required to find the maximum and minimum node values from a circular linked list, a 'Node' class needs to be created. In this class, there are two attributes, the data that is present in the node, and the access to the next node of the linked list.In a circular linked list, the head and the rear are adjacent to each other. They are connected to form a circle, and don't have 'NULL' value in the last node.Another class needs to be created that would have an initialization function, and the head of the node would be initialized ...

Read More

Python program to insert a new node at the beginning of the Circular Linked List

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 662 Views

When it is required to insert a new node at the beginning of a circular linked list, a 'Node' class needs to be created. In this class, there are two attributes, the data that is present in the node, and the access to the next node of the linked list.In a circular linked list, the head and the rear are adjacent to each other. They are connected to form a circle, and don't have 'NULL' value in the last node.Another class needs to be created that would have an initialization function, and the head of the node would be initialized ...

Read More

Python program to insert a new node at the end of the Circular Linked List

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 516 Views

When it is required to insert a new node at the end of the circular linked list, a 'Node' class needs to be created. In this class, there are two attributes, the data that is present in the node, and the access to the next node of the linked list.In a circular linked list, the head and the rear are adjacent to each other. They are connected to form a circle, and don't have 'NULL' value in the last node.Another class needs to be created that would have an initialization function, and the head of the node would be initialized ...

Read More

Python program to insert a new node at the middle of the Circular Linked List

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 396 Views

When it is required to insert a new node at the middle of the circular linked list, a 'Node' class needs to be created. In this class, there are two attributes, the data that is present in the node, and the access to the next node of the linked list.In a circular linked list, the head and the rear are adjacent to each other. They are connected to form a circle, and don't have 'NULL' value in the last node.Another class needs to be created that would have an initialization function, and the head of the node would be initialized ...

Read More

Python program to remove duplicate elements from a Circular Linked List

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 426 Views

When it is required to remove duplicates from a circular linked list, a 'Node' class needs to be created. In this class, there are two attributes, the data that is present in the node, and the access to the next node of the linked list.In a circular linked list, the head and the rear are adjacent to each other. They are connected to form a circle, and don't have 'NULL' value in the last node.Another class needs to be created that would have an initialization function, and the head of the node would be initialized to 'None'. Multiple methods are defined ...

Read More

Write a Python program to remove a certain length substring from a given string

Prasad Naik
Prasad Naik
Updated on 11-Mar-2026 233 Views

We need to write a Python program which will remove a certain substring from a given stringAlgorithmStep 1: Define a string. Step 2: Use the replace function to remove the substring from the given string.Example Codeoriginal_string = "C++ is a object oriented programming language"modified_string = original_string.replace("object oriented", "")print(modified_string)OutputC++ is a  programming languageExplanationThe in-build Python replace() function takes the following parameters:Oldstring: The string which you want to removeNewstring: The new string you want to replace in place of the oldstringCount: Optional. Number of times you want to replace the oldstring with the newstring

Read More
Showing 741–750 of 8,547 articles
« Prev 1 73 74 75 76 77 855 Next »
Advertisements