AmitDiwan has Published 11365 Articles

What are Pickling and Unpickling in Python?

AmitDiwan

AmitDiwan

Updated on 15-Sep-2022 12:13:28

7K+ Views

To serialize and de-serialize a Python object structure, we have the Pickle module in Python. The pickle module implements binary protocols for serializing and de-serializing a Python object structure. Pickling is the process through which a Python object hierarchy is converted into a byte stream. To serialize an object hierarchy, ... Read More

Numpy Array advantage over a Nested List

AmitDiwan

AmitDiwan

Updated on 15-Sep-2022 12:11:12

1K+ Views

In this article, we will learn about the advantages of a Numpy array with a Nested List in Python. The Numpy array definitely has advantages over a Nested. Let’s see the reasons − The array in Numpy executes faster than a Nested List. A Nested List consumes more memory ... Read More

Explain how Python is an interpreted language

AmitDiwan

AmitDiwan

Updated on 15-Sep-2022 11:59:15

4K+ Views

Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. Python is processed at runtime by the interpreter. You do not need to compile your program before executing it. This is similar to PERL and PHP. Steps of Execution Step1 − A Python source code is written by the ... Read More

How to use the slicing operator in Python?

AmitDiwan

AmitDiwan

Updated on 15-Sep-2022 11:54:39

2K+ Views

The slice operator is used to slice a string. The slice() function can also be use for the same purpose. We will work around the slice operator with some examples What is Slicing? Slicing in Python gets a sub-string from a string. The slicing range is set as parameters i.e. ... Read More

Reloading modules in Python?

AmitDiwan

AmitDiwan

Updated on 16-Aug-2022 12:12:47

17K+ Views

The reload() is used to reload a previously imported module or loaded module. This comes handy in a situation where you repeatedly run a test script during an interactive session, it always uses the first version of the modules we are developing, even we have made changes to the code. ... Read More

Three way partitioning of an array around a given range using Python

AmitDiwan

AmitDiwan

Updated on 12-Aug-2022 14:36:50

252 Views

Given an array and the range of the array [startval, endval]. Array is divided by three parts. All elements smaller than startval come first. All elements in range startval to endval come next. All elements greater than endval appear in the end. Let’s say we have the following ... Read More

Python Truth Value Testing

AmitDiwan

AmitDiwan

Updated on 12-Aug-2022 12:54:26

901 Views

What is Truth Value We can use any object to test the truth value. By providing the condition in the if or while statement, the checking can be done. Until a class method __bool__() returns False or __len__() method returns 0, we can consider the truth value of that object ... Read More

What is the process of compilation and linking in python?

AmitDiwan

AmitDiwan

Updated on 12-Aug-2022 12:51:26

6K+ Views

Compilation − The source code in python is saved as a .py file which is then compiled into a format known as byte code, byte code is then converted to machine code. After the compilation, the code is stored in .pyc files and is regenerated when the source is updated. ... Read More

Difference between Python iterable and iterator

AmitDiwan

AmitDiwan

Updated on 12-Aug-2022 12:48:42

552 Views

What is an iterable? An iterable can be loosely defined as an object which would generate an iterator when passed to inbuilt method iter(). There are a couple of conditions, for an object to be iterable, the object of the class needs to define two instance method: __len__ and __getitem__. ... Read More

How to input multiple values from user in one line in Python?

AmitDiwan

AmitDiwan

Updated on 12-Aug-2022 12:44:02

5K+ Views

In Python, to get values from users, use the input(). This works the same as scanf() in C language. Input multiple values from a user in a single line using input() To input multiple values in one line, use the input() method − x, y, z = input(), input(), input() ... Read More

Advertisements