Python

How to Create Array of zeros using NumPy in Python?

Creating Array of zeros using NumPy in Python Creating an array of zeros using NumPy in Python can be done with the np.zeros() function. This function is very useful when you need an array initialized with zeros for tasks like array operations, matrix manipulations, and initializations for algorithms. SYNTAX: numpy.zeros(shape, dtype=float, order=’C’) Parameters shape: An …

How to Create Array of zeros using NumPy in Python? Read More »

str() vs repr() function in python

by : D.BHUVANESHWARI str() vs repr() function in python str() : This function is used to represent the string. Python programming language is used to convert the specified value into a string datatype. str() function Syntax: str(object, encoding=’utf-8?, errors=’strict’) object: The object whose string representation is to be returned. encoding : Encoding of the given …

str() vs repr() function in python Read More »

Python program to create a class which performs basic calculator operations.

In Python Programming Language , a class is a blueprint for creating objects . It defines the attributes and behaviours that the objects will have. Basic calculator consists of operations like addition, subtraction, multiplication, division. class Calculator: def add(self, x, y): return x + y def subtract(self, x, y): return x – y def multiply(self, …

Python program to create a class which performs basic calculator operations. Read More »

What does the \’b\’ character do in front of a string literal in python

By: BHUVANESHWARI In python , the ‘b’ character before a string is used to specify the string as a “byte string”. By adding  the ‘b’ character before a string literal, it becomes a bytes literal. The string content should be a series of bytes and not character. Bytes literals are utilized  for representing binary data …

What does the \’b\’ character do in front of a string literal in python Read More »

Merge two PDF files into a single using Python

The PDF format which stands for Portable Document Format is widely used for displaying text and graphics in a consistent manner across different platforms and software applications. Python  being a high level programming language offers versability and ease of use when it comes to working with various computer systems. However handling source PDF files and …

Merge two PDF files into a single using Python Read More »

Scroll to Top