
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

389 Views
Python has various internal functions like isspace(), lstrip(), and replace() are used for trimming a given string. It means it will remove the whitespace from the left side of the string. Let’s take an example to understand the trim of a string from the left side. In the given string “MICROBOX” remove the left string MI and get the result value as “CROBOX”. In the given string “synapse” remove the left string syn and get the result value as “apse”. In this article, we will learn how to develop a Python program that will trim the string from ... Read More

7K+ Views
Multiple files are compressed together and stored in a single file format called a zip file. There are some applications such as file management, data processing, file conversion, and backup & archive of files. In Python, we have zip in-built functions like infolist() and namelist() that can be used to Read and printing all files from a zip file. We utilize the predefined method 'namelist()' or 'infolist' to read the data within the zip folder in order to output all of the files that are currently present inside the zip file. Input // This is a zip folderOutput The ... Read More

9K+ Views
In Python, we have some file in-built functions that can be used to count the number of lines present in the file. We will open the notepad and write some lines of text into it. Then use this file in the file handling program in Python to count the total number of lines present in the file. The ‘r’ mode is defined by reading the file's text. Syntax The following syntax is used in the example is − with open("file_name.txt", mode) The open method is used for opening a file in Python. This accepts the two parameters − ... Read More

2K+ Views
In Python, we have file handling in-built functions like open(), write(), and close() that can be used to Append a String or Text to an Existing File. The term append is used in the program of file handling in Python. To append the text or string means that the user writes the new text to the existing file. The main purpose of adding text to an existing file means giving extra information to the existing file. Note-taking and Data collection are such applications of this program. Syntax The following syntax is used in the example is − open("file_name.txt", mode) ... Read More

274 Views
In this article, we will learn how to create a Python program to delete prefix substrings from a given string. Sometimes in data, we have a prefix of multiple words of the same type and if we want to delete them then it will take a lot of time but this can be solved by giving an algorithm to it. A prefix is a group of characters that are added to the beginning. Let’s take an example to understand this. The given string variable is “My shirt color is Red” and delete the prefix variable i.e. “My”. Then, the final ... Read More

2K+ Views
In Python, we have some built-in string functions like rstrip(), replace(), and endswith() that can be used to delete suffix from the given string. The delete suffix is termed by removing the group of characters at the end of the string. Sometimes we find errors like suffix in any data and if we want to delete it, it takes a lot of time and this can be solved by giving an algorithm to it. The end character or substring is termed a suffix. Let’s take an example to understand this − The given string variable is BRIGHTNING and after removing ... Read More

736 Views
Python has various built-in functions that can be used for capitalization of the string. In this article develop a python program to perform this task using its lower() function. The lower() method converts each uppercase character in the input string to lowercase before returning the lowercased strings. It returns the original string if the given string contains no uppercase letters. The lower function doesn’t take any parameters. Let’s take an example to understand the conversion of string in lowercase − SCHOOL ----------- school UnIvErSiTy ----------- university Syntax ord() The ord() is a predefined function used in Python ... Read More

1K+ Views
While creating plots using Matplotlib which is a library of Python one common task is to add markers to indicate data points. Matplotlib provides a variety of marker styles which includes circles, triangles, squares, dots, and diamonds. These markers can be customized further with different sizes, colors, and edge sizes. In this article, we will discuss how to add markers to a graph plot and customize them in Matplotlib with Python. Matplotlib Matplotlib is a library that is mainly used for plotting graphs and plots for the Python programming language and NumPy, its extension for numerical mathematics. Tkinter, wxPython, ... Read More

740 Views
Decision trees and K-means clustering algorithms are popular techniques used in data science and machine learning to uncover patterns and insights from large datasets like the iris dataset. As we all know, Artificial Intelligence is employed extensively in our daily lives, from reading the news on a mobile device to analyzing complicated data at work. AI has improved the speed, accuracy, and efficiency of human endeavors. AI developments have enabled us to do things that were previously deemed impossible. Here in this article, we will learn about the decision tree algorithm and k means clustering algorithm and how to ... Read More

793 Views
Earthquakes are natural phenomena that can have effects on human life and infrastructure. With the availability of geospatial and seismic datasets, scientists and researchers can analyze and visualize the earthquake data to identify the patterns, trends, and risk zones. Python, along with libraries like Matplotlib, Pandas, and NumPy, provides the tools to process and visualize the data. In this article, we are going to analyse and visualize earthquake data in Python with Matplotlib. Analyzing and visualizing Earthquake For the examples in this article, we use the dataset named "demo_1.csv" that contains information about the earthquakes. The data ... Read More