The Python sys module provides easy functions that allow us to interact with the interpreter directly. It lets us access system-specific parameters and functions. First, we have to import the sys module in our program before running any functions. import …
Python does not have any built-in increment(both pre and post) operator like any other programming languages. In Python, you can increase the value of a variable by 1 using the augmented assignment operators. The code value += 1 increments the numeric values in value by 1.
Python 2 and 3 got many differences between them. In this article, we will go through some important differences between them. While comparing these two, it is pretty clear that python 3 is much better than 2. Python 2 is …
In this article, we will see how to save image in Python. The library used for image editing is the PIL library. It is an imaging library. The Image class is used to represent a PIL image. Using this class we can …
In this article, we will see how to check if a list is empty or not. A list is said to be empty when there are no elements in the list. Method 1: Output: Method 2: Output:
In this article, we will see how to change line in python. If you are looking for ‘how to go to next line in python’, this article will help you for the same. The new line character \n in Python …
In this article, we will see how to convert list to set.We can use the Python set() function to convert list to set. In Python Sets, duplicates are not allowed, hence when a list is converted to set, all duplicates will be …
In this article, we will learn how to install a package. If you’re using Windows, you’ll be able to install a Python package by opening the Windows Command Prompt, and then type this command: pip install package name Let’s go through …
In this article, we will see how to create an exe file in python. In the Windows Command Prompt, type the following command to install the pyinstaller package : pip install pyinstaller Create a new python file. Then go to command prompt, and type …
To change the current working directory(CWD), os.chdir() method in the OS module is used. This method changes the CWD to a specified path. It takes a single argument as a new directory path. os.getcwd() is used to get the current working directory. The …