
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10476 Articles for Python

2K+ 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 substring in a string. Method 1: Using the find() method The find method searches for the specific substring which is passed as a parameter to the function and returns the starting index of the substring. If the substring is not found in the string then the find() method returns -1. ... Read More

759 Views
In Python, we can use various methods like using square brackets, slicing, and using indices to get characters from the string with the help of their index. A string is a sequence of characters with each character being assigned a unique index. The index specifies the position of the character in the string. The index of the first character starts with 0 and the index of the last character in the string is the length of the string minus one. We can use the index value of the character to access a particular character in the string. Accessing Characters From ... Read More

408 Views
In Python we can get a character from the given string using the indexing operator ‘[ ]’, using slices, and using indices separated by a colon. By passing the index of the character we want to access to the index operator we can easily get the character from the string. In this article, we will see how we can access the character of the string using the index operator. Using [ ] Operator Syntax string[index] Here string is the given string from which we want to access a specific character. The index is the index of the character in ... Read More

2K+ Views
In Python, a subset of a string is a sequence of characters that is part of the original string. We can find all the subsets of a string using itertools module in Python. In this article, we will see how we can generate all the subsets of a string by making all possible combinations of characters in the string. Syntax itertools.combination(string, r) The combination() function of itertools module takes the string and r which represents the size of different combinations of strings that are possible.It returns all the combinations of characters of the string that are possible. Algorithm ... Read More

5K+ Views
In Python, a string can be divided into N equal parts using the slicing method. Substrings of equal length can be extracted using the Python slicing method by specifying the starting and ending index of the substring. In his article, we will see how we can divide a string into N equal parts using the Python slicing method. To divide a string into N equal parts we need to create a function that takes the original string and the number of parts in which the string is to be divided as input and returns the resultant N equal strings.If the ... Read More

409 Views
In Python, we can use the pathlib module, os module, and glob module to display all the folders in a directory. The os module contains various functions like os.scandir, os.walk , os.listdir or glob(), and iglob() methods, etc to list all the directories in a directory. A directory is a folder in a file system that stores various files or more folders. Method 1: Using the Pathlib Module We can use the Path.iterdir() function to get the path object of the contents in the directory. We can then iterate over the path objects and filter out the directories using the path.is_dir() ... Read More

1K+ Views
The first law of thermodynamics is related to energy conservation, i.e., if energy in form disappears then the energy will in appear in some other form. In thermodynamics majorly we are concerned about heat, work and internal energy. Heat and work are the form of energy which are also called as "energy in transit", hence they are path functions. They cannot be stored by a system, whereas internal energy is the property of the system which can be stored by system. For a closed system, the first law is written as − $$\mathrm{\Sigma Q=\Sigma W}$$ But this is only valid ... Read More

332 Views
Introduction Python ranks as one of the most widely used programming languages for machine learning for its simplicity of being used, adaptability, and broad library and tool set. Yet, one challenge that many developers have when working with Python for machine learning is how to resume work if their system unexpectedly restarts. This is incredibly frustrating if you've spent hours or days training a machine learning model only to have all of your efforts destroyed due to a sudden shutdown or restart. In this post, we'll look at different ways for resuming Python machine-learning work once your system has restarted. ... Read More

711 Views
Introduction Memory problems are a regular complication when using Python machine learning programs, especially when working with sizable datasets. Making these errors might hinder the performance of your code and make it difficult to complete demanding machine-learning tasks. A memory error is an illustration of a runtime error; it occurs when a piece of software tries to allocate more memory than the system can handle. This can happen when a Python machine learning script tries to load a large dataset into memory while creating an excessive number of objects, or when using bad data structures. According to certain error messages, ... Read More

193 Views
Introduction Machine learning is a rapidly developing field, and fresh techniques and algorithms are being created all the time. Yet, creating and enhancing machine learning models may be a time-consuming and challenging task that necessitates a high degree of expertise. Automated machine learning, commonly known as autoML, aims to streamline the creation and optimization of machine learning models by automating a number of labor-intensive tasks such as feature engineering, hyperparameter tweaking, and model selection. Built on top of scikit-learn, one of the most well-known machine learning libraries in Python, auto-sklearn is a potent open-source framework for automated machine learning. It ... Read More