I have an requirement like -: Step 1- Create an empty list Step 2- Push data into the empty list Step 3- Sort the original list Step 4- Save the sorted list in another variable. 5- Compare the sorted list with original list.
CodePudding user response:
In Python, an empty list can be created by just writing square brackets i.e. []. If no arguments are provided in the square brackets [], then it returns an empty list i.e.
CodePudding user response:
Python is a multi-paradigm, dynamically typed, multi-purpose programming language. It is designed to be quick to learn, understand, and use, and enforces a clean and uniform syntax. Please note that Python 2 is officially out of support as of 2020-01-01. Still, for version-specific Python questions, add the [python-2.7] or [python-3.x] tag. When using a Python variant (e.g. Jython, PyPy) or library (e.g. Pandas, NumPy), please include it in the tags.