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 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 …
Flask is a lightweight WSGI web application framework. It is a micro web framework written using Python. Installing flask in your system is simple. Just use the following command: pip install -U Flask
A list can be copied using = operator. But the problem with it is that, if we make any changes to the initial list, that change will appear on the new list also. This happens because, the = operator creates …
You can rename a file using naive method like just going to the properties of the file and change its name. Or else you can rename a file using Python. os.rename() method in OS module of Python is used to rename …