
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 10401 Articles for Python

1K+ Views
A common method for extracting data from web pages is known as web scraping, and the potent Python package BeautifulSoup makes it simple to do so. In this post, we'll concentrate on utilizing Python's BeautifulSoup to extract title tags from a given HTML text. Installation and Syntax Make sure BeautifulSoup is set up on your machine before you start writing any code, this can be done via the Python package installer, pip by typing out the command in your terminal. pip install beautifulsoup4 We must first build a BeautifulSoup object by supplying the HTML content or file to ... Read More

855 Views
In python, a matrix is a particular type of two-dimensional array in which all of the data elements must have exactly the same size. Hence, every matrix is also a two-dimensional array, but not the other way around.For many mathematical and scientific tasks, matrices are essential data structures. In this article, we will learn a python program to reverse every Kth row in a Matrix. Methods Used The following are the various methods to accomplish this task − Using for loop and reversed() function Using list comprehension and slicing Using index() and reverse() functions Using range() function ... Read More

659 Views
In Python, dictionary is a implementation of a data structure known more commonly as an associative array. A dictionary is made up of a group of key-value pairs. Each key-value combination corresponds to a key and its corresponding value. In this article, we will learn a python program to print the sum of all key-value pairs in a dictionary. Methods Used The following are the various methods to accomplish this task: Using For Loop and append() function(dictionary traversal method) Using dict.keys() Function Using For Loop, keys() and values() Functions Example Assume we have taken an input dictionary. ... Read More

295 Views
To find the tuple indices from other tuple list we can use enumerate function and index function of Python. An ordered and immutable group of objects is referred to as a tuple. Sequences are just what tuples and lists both are. Tuples and lists vary in that tuples cannot be altered, although lists may, and because tuples use parentheses while lists use square brackets. Example Assume we have taken an input list containing tules and another search tuple list. We will now search the indices of the search tuple list in the given input list Input inputList = [(1, 3), ... Read More

755 Views
In python we are can use simple for loop and max, count and operator function to find the maximum value from the dictionary whose key is present in the list. Python's implementation of a data structure known more commonly as an associative array is a dictionary. A dictionary is made up of a group of key-value pairs. Each key-value combination corresponds to a key and its corresponding value. Example Assume we have taken an input dictionary and input list. We will now find the maximum value from an input dictionary whose key is also present in the input list. ... Read More

129 Views
Python's implementation of a data structure known more commonly as an associative array is a dictionary. A dictionary is made up of a group of key-value pairs. Each key-value combination corresponds to a key and its corresponding value. In this article, we will learn a python program to extract dictionaries with the maximum number of keys. Methods Used The following are the various methods to accomplish this task: Using for loop and len() function Using list comprehension and max() function Example Assume we have taken an input list containing multiple dictionaries. We will now extract dictionaries ... Read More

158 Views
Python's implementation of a data structure known more commonly as an associative array is a dictionary. A dictionary is made up of a group of key-value pairs. Each key-value combination corresponds to a key and its corresponding value. In this article, we will learn a python program to extract dictionaries with a given Key from a list of dictionaries. Methods Used The following are the various methods to accomplish this task: Using list comprehension and keys() function Using filter() and lambda functions Using operator.countOf() method Example Assume we have taken an input list containing dictionaries and an input ... Read More

2K+ Views
Python's implementation of a data structure known more commonly as an associative array is a dictionary. A dictionary is made up of a group of key-value pairs. Each key-value combination corresponds to a key and its corresponding value. In this article, we will learn a python program to convert URL parameters to dictionary items. Methods Used The following are the various methods to accomplish this task − Using urllib.parse.parse_qs() function Using setdefault() and re.findall() functions Using split() function Example Assuming we have taken an input string with URL parameters, we convert this query string to the ... Read More

167 Views
In python an array(list) of comma-separated values (items) enclosed in square brackets is one of the most flexible data types available in Python. The fact that a list's elements do not have to be of the same type is important. In this article, we will learn a python program to check whether a number formed by combining all elements of the array is a palindrome. Methods Used The following are the various methods to accomplish this task: Using map() & join() functions Using type casting & string concatenation Using str(), list(), extend(), join() and reverse() functions Example ... Read More

1K+ Views
In Python, dictionary is a implementation of a data structure known as an associative array. A dictionary is made up of a group of key-value pairs. Each key-value combination corresponds to a key and its corresponding value. In this article, we will learn how to convert into a Set of dictionary values in python. Methods Used The following are the various methods to accomplish this task: Using generator expression and {} Using values() and set() functions Using Counter() function Example Assume we have taken an input dictionary. We will now extract all the values of a ... Read More