Hussain Nasir Khan

A programmer, writer, and engineer. I have a deep interest in computer vision and artificial intelligence.

Python list reverse

Python list reverse

In this article, you’ll see how to reverse a list in Python. The reverse method is used to reverse all the elements of a list. I highly recommend you get the “Python Crash Course Book” to learn Python. Output: [15, 10, 25, 20, 9]

Python list insert

Python list insert

In this article, you’ll see how to insert an element into a list in Python. The insert method is used to add an element to a list at any position. The append method takes two arguments. The first argument is the index, and the second argument is the element that can be an integer, float, …

Python list insert Read More »

Python list sort

Python list sort

In this article, you’ll see how to sort a list in Python. The sort method is used to sort the elements in ascending or descending order. I highly recommend you get the “Python Crash Course Book” to learn Python. Sort the list in ascending order If you want to sort a list in increasing order then don’t …

Python list sort Read More »

Python list pop

Python list pop

In this article, you’ll see the Python list pop method. The pop method is used to remove an element from a list. The Python list pop method takes only one argument. If you don’t specify any index position in the argument then it will remove the last element. I highly recommend you get the “Python …

Python list pop Read More »

Python list append

Python list append

In this article, you’ll see how to append a list in Python. The append method is used to add an element to a list. It adds an element at the end of the list. The append method takes only one argument. The argument can be integer, string, float, or any other data type such as …

Python list append Read More »

Face Detection using OpenCV Python

Face Detection using OpenCV Python

In this article, you’ll see face detection using OpenCV in Python. You have to follow these steps to detect faces. I highly recommend you get the “Computer Vision: Models, Learning, and Inference Book” to learn Computer Vision. Step 1: Import Libraries Import the required Libraries. Step 2: Read an Image Read an image from the location. In …

Face Detection using OpenCV Python Read More »

How to rotate an image in Pillow Python

How to rotate an image in Pillow Python

In this article, you’ll see how to rotate an image in Pillow Python. To rotate an image you have to specify the angle of rotation. Output: Rotate an Image with expand parameter Output: Recommendation: Computer Vision: Models, Learning, and Inference Book

PIL image crop

How to crop an image in PIL (Pillow Python)

In this article, you’ll see how to crop an image in PIL Python. To crop an image you have to specify the exact position (points). In the following example, (0,0) is the start point, and (500, 300) is the endpoint. Output: Recommendation: Computer Vision: Models, Learning, and Inference Book

How to save an image in Pillow Python

How to save an image in Pillow Python

In this article, you’ll see how to save an image in Pillow Python. To read and save an image you just need to change the name and location of the image. Output: Recommendation: Computer Vision: Models, Learning, and Inference Book