
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10476 Articles for Python

32K+ Views
Using subplot(row, col, index) method, we can split a figure in row*col parts, and can plot the figure at the index position. In the following program, we will create two diagrams in a single figure.StepsCreating x, y1, y2 points using numpy.With nrows = 1, ncols = 2, index = 1, add subplot to the current figure, using the subplot() method.Plot the line using x and y1 points, using the plot() method.Set up the title, label for X and Y axes for Figure 1, using plt.title(), plt.xlabel(), and plt.ylabel() methods.With nrows = 1, ncols = 2, index = 2, add subplot ... Read More

8K+ Views
To save the images in Python with very high quality, you need to follow the steps given below −Create fig and ax variables using subplots method, where default nrows and ncols are 1.Plot the lines using plot() method.We can add axes labels using ylabel() and xlabel().To get a high-quality image, we can use .eps image format.You can increase the dot per inch value, i.e., dpi.Using savefig() method, we can save the image locally.To show the figure, use plt.show().Exampleimport matplotlib.pyplot as plt fig, ax = plt.subplots() plt.plot([0, 5], [0, 5]) plt.ylabel("Y-axis ") plt.xlabel("X-axis ") image_format = 'eps' ... Read More

364 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

358 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

459 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

617 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

322 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

217 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

373 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

1K+ Views
In this article, let's try to print an inverted star pattern. This pattern involves publishing a series of stars(*) in each line arranged in a descending order. For example, if the N=5 then the output should be − ***** **** *** ** * For printing star (*) patterns frequently, we use for loops. Let's discuss the for loop in Python. Python for loop The for loop in Python provides the ability to loop over the items of any sequence, such as a list, tuple, or string. It performs the same action on each item of the sequence. This ... Read More