We can compare two strings in python by comparison operators. There are many comparison operators like ‘==’, ‘!=’, ‘>’, ‘<‘, etc. String comparison in python takes place character by character. == – It checks whether two strings are equal. != …
Python comes with a built-in random library. It has got lots of functions included with this library such as choice, randint etc. For generating a random number in python firstly we have to import a module random. E.g., In this …
In any programming language, printing output is a most important task. In python also printing output is the most important task. Printing output in the same line is also a task in python. We have some methods by which we …
As we all know that there is no in-built function to clear the screen in python. But sometimes it becomes very necessary to clear the screen. In the interactive python shell we can clear screen it by pressing “control + …
When you are writing a program it is necessary that your program is easily readable and easy to understand by others. An easy way to increase the readability of the program is to use comment. Multiline comment is a type …
Class based functions include a reference to self so that you can know which class instance called it. It represents the instance of the class. It is not a keyword in python. We can access attributes and methods of class …
You have to install python before starting to work in it. There are multiple ways and different versions of python available today. When you are done with the installing process of python you can run your program in the following …
First of all we should know what is opencv? OpenCV (Open Source Computer Vision) is a library of programming functions mainly aimed at real-time computer vision. In simple language it is a library used for Image Processing. It is mainly used …
Conversion of a string to list in Python is a pretty easy job. We can convert string into list by using split(). e.g., We’ll see another example in which we convert string into a list of characters. e.g., Now we are going …
Python gives us freedom to take the input from the user. The input we take from the user is read as string by default. After giving input we have to press “Enter”. Then only the input() function reads the value …