AmitDiwan has Published 10744 Articles

How do I read (or write) binary data in Python?

AmitDiwan

AmitDiwan

Updated on 16-Sep-2022 12:12:31

13K+ Views

To read or write a binary file, at first you need to understand the different file modes for Binary Files in Python − Mode Description rb Opens a file for reading only in binary format. The file pointer is placed at the beginning of the file. ... Read More

What are the new features added in Python 3.10 version?

AmitDiwan

AmitDiwan

Updated on 16-Sep-2022 12:10:30

259 Views

In this article, we will learn the new features in Python 3.10, compared to 3.9. Let’s see the features − Parenthesized context managers Using enclosing parentheses for continuation across multiple lines in context managers is now supported. This allows formatting a long collection of context managers in multiple lines in ... Read More

How do I delete a file in Python?

AmitDiwan

AmitDiwan

Updated on 16-Sep-2022 12:08:33

2K+ Views

To delete a file, use the remove() method in Python. Pass the name of the file to be deleted as an argument. Let us first create a file and read the content: We will display the contents of a text file. For that, let us first create a text file ... Read More

Functional Programming in Python

AmitDiwan

AmitDiwan

Updated on 16-Sep-2022 12:03:59

1K+ Views

Functional programming languages are specially designed to handle symbolic computation and list processing applications. Functional programming is based on mathematical functions. Some of the popular functional programming languages include: Lisp, Python, Erlang, Haskell, Clojure, etc. Characteristics of Functional Programming The most prominent characteristics of functional programming are as follows − ... Read More

What does [::-1] do in Python?

AmitDiwan

AmitDiwan

Updated on 15-Sep-2022 14:28:57

22K+ Views

Slicing in Python gets a sub-string from a string. The slicing range is set as parameters i.e. start, stop and step. For slicing, the 1st index is 0. For negative indexing, to display the 1st element to last element in steps of 1 in reverse order, we use the [::-1]. ... Read More

What is slicing in Python?

AmitDiwan

AmitDiwan

Updated on 15-Sep-2022 14:22:36

2K+ Views

Slicing in Python gets a sub-string from a string. The slicing range is set as parameters i.e. start, stop and step. Syntax Let us see the syntax # slicing from index start to index stop-1 arr[start:stop] # slicing from index start to the end arr[start:] # slicing from ... Read More

What are the basic concepts of Python?

AmitDiwan

AmitDiwan

Updated on 15-Sep-2022 13:45:39

20K+ Views

Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. Features of Python Following are key features of Python − Python supports functional and structured programming methods as well as OOP. It can be used as a scripting language or can be compiled to byte-code for building large ... Read More

What type of language is python?

AmitDiwan

AmitDiwan

Updated on 15-Sep-2022 13:43:59

4K+ Views

Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Let’s understand the paradigms one by one. Paradigms classify programming languages based on their features. Interpreted Language Python is processed at runtime by the interpreter. You do not need to compile your program before executing it. This is similar ... Read More

How are dataframes in Pandas merged?

AmitDiwan

AmitDiwan

Updated on 15-Sep-2022 13:43:21

306 Views

Pandas is an open-source Python Library providing high-performance data manipulation and analysis tool using its powerful data structures. A Data frame in Pandas is a two-dimensional data structure, i.e., data is aligned in a tabular fashion in rows and columns. In this article, we will see how to merge dataframes ... Read More

How to create an empty class in Python?

AmitDiwan

AmitDiwan

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

6K+ Views

A class in Python user-defined prototype for an object that defines a set of attributes that characterize any object of the class. The attributes are data members (class variables and instance variables) and methods, accessed via dot notation. We can easily create an empty class in Python using the pass ... Read More

Advertisements