Rohan Singh has Published 171 Articles

Difference between BeautifulSoup and Scrapy Crawler

Rohan Singh

Rohan Singh

Updated on 06-Jul-2023 17:34:01

138 Views

Beautiful Soup and Scrapy Crawler are used for doing web scraping in Python. Both of these tools have the same use case but have different functionalities. Web scraping is useful in data collection and analysis in fields like research, marketing, and business intelligence. In this article, we will understand the ... Read More

Adam Optimizer in Tensorflow

Rohan Singh

Rohan Singh

Updated on 06-Jul-2023 17:24:01

880 Views

Adam optimizer in Tensorflow is an algorithm used in deep learning models. Optimization algorithms are used in deep learning models to minimize the loss function and improve performance. Adam stands for Adaptive Moment Estimation, which is a stochastic gradient descent algorithm. It combines the advantages of both RMSprop and AdaGrad ... Read More

Accessing Web Resources using Factory Method Design Pattern in Python

Rohan Singh

Rohan Singh

Updated on 06-Jul-2023 17:07:07

102 Views

The Factory Method Design Pattern of Python is a creational pattern that provides an interface for creating objects in a superclass but allows subclasses to alter the type of objects that will be created. It is used to define a generic interface for creating objects while allowing subclasses to decide ... Read More

Python Program to Replace the Spaces of a String with a Specific Character

Rohan Singh

Rohan Singh

Updated on 17-Apr-2023 11:10:27

10K+ Views

In Python, the spaces of a string with a special character can be replaced using replace() method. The replace method replaces all occurrences of the passed substring with a new substring. In this article, we will see how we can use replace() method to replace the spaces of a string ... Read More

Python Program to open a file in the read-write mode without truncating the file

Rohan Singh

Rohan Singh

Updated on 17-Apr-2023 11:09:33

2K+ Views

In Python, we can open a file in a read-write mode without truncating the file by opening the file in a+ mode. Truncating a file refers to deleting the existing content of the file before opening the file. In this article, we will discuss how we can open the file ... Read More

Python Program to open a file in read-write mode with truncating file

Rohan Singh

Rohan Singh

Updated on 17-Apr-2023 11:06:10

2K+ Views

In Python, we can open a file in read-write mode by truncating the file by opening the file in w+ mode. Truncating a file refers to deleting the existing content of the file before opening the file. In this article, we will discuss how we can open the file in ... Read More

Python Program to Lookup enum by String value

Rohan Singh

Rohan Singh

Updated on 17-Apr-2023 11:05:31

5K+ Views

Enum in Python is a user-defined data type consisting of a set of named values. A finite set values of is defined using enums and these values can be accessed in Python using their names instead of their integer values. Enum makes the code more readable, and more maintainable and ... Read More

Python Program to Insert a string into another string

Rohan Singh

Rohan Singh

Updated on 17-Apr-2023 11:02:06

8K+ Views

In Python, we can insert a string into another string using the string concatenation method, string interpolation method, and using replace() method. Python provides various ways to insert a string into another string. In this article, we will understand all the methods with the help of suitable examples. Method 1: ... Read More

Python Program to implement switch statement on String

Rohan Singh

Rohan Singh

Updated on 17-Apr-2023 10:56:58

1K+ Views

In Python, we can implement switch statements on a string using the dictionary-based approach, class-based approach, and lambda-based approach. Unlike other programming languages like Java, c++, etc python does not have an inbuilt switch statement. In this article, we will see how we can achieve the switch statement functionality in ... Read More

Python Program to get the index of the substring in a string

Rohan Singh

Rohan Singh

Updated on 17-Apr-2023 10:54:19

1K+ Views

In Python we can use the find() and index() methods to get the index of the first occurrence of the substring in a string. Python provides various string manipulation functions to modify and access text data. In this article, we will write a program to get the index of the ... Read More

Advertisements