- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 10784 Articles for Python
![Jaisshree](https://www.tutorialspoint.com/assets/profiles/626154/profile/60_732783-1679645062.jpeg)
316 Views
The size of the NumPy arrays can be changed with the help of two functions in python namely reshape and resize. There's only one thing that differentiates them, the original array remains unchanged while using resize() while reshape() returns only the changed array and the original array remains intact. Syntax Reshape() reshape(x, y) In this syntax, x specifies the number of smaller arrays that has to be created from the larger array provided as input and y denotes the actual number of elements present in the array. The method returns a modified array if the ... Read More
![Jaisshree](https://www.tutorialspoint.com/assets/profiles/626154/profile/60_732783-1679645062.jpeg)
111 Views
A queue is a data structure which follows a FIFO (First In First Out) delivery method that is, the order of a set of messages is strictly preserved. It processes all messages exactly once, hence, there's no duplication of messages. The advantage of a FIFO system over a standard delivery method is because of a queue's ability to support unlimited throughput due to the application of batch-processing of queues. FIFO has high throughput (amount of items passing through a process) and can process a lot more messages than average. In Python, queues can be implemented via two main ... Read More
![Atharva Shah](https://www.tutorialspoint.com/assets/profiles/626166/profile/60_735606-1679646268.png)
612 Views
Python dictionaries are flexible data structures that hold key-value pairs effectively. A nested dictionary is a hierarchical data structure to organize and manage large amounts of data. This article shows how to construct a nested dictionary from a given list, enabling dictionary users to perform a variety of tasks. Syntax Nest multiple levels of dictionaries to accommodate complex data structures. nested_dict = { 'outer_key': { 'inner_key': 'value' } } Algorithm 1. Create a new dictionary to contain the layered structure. 2. Go through the given list iteratively. 3. Extract the necessary information for keys and ... Read More
![Atharva Shah](https://www.tutorialspoint.com/assets/profiles/626166/profile/60_735606-1679646268.png)
82 Views
In the realm of GUI programming, wxPython has emerged as a powerful and versatile library, empowering developers to craft stunning graphical user interfaces with ease. Among the many essential components, toolbars play a vital role in providing users with quick access to various functionalities. In this tutorial, we'll dive into the art of creating multiple toolbars using wxPython. By the end, you'll be equipped with the knowledge to enhance your GUI applications with multiple toolbars, thereby offering an improved user experience. Installation wxPython Library for GUI Prototyping As a wrapper for the C++ library wxWidgets, wxPython allows ... Read More
![Atharva Shah](https://www.tutorialspoint.com/assets/profiles/626166/profile/60_735606-1679646268.png)
507 Views
Python's key data structures are lists and tuples. Once elements of tuples are set they cannot be changed. This is called immutability. But list elements can be modified after initialization. When dealing with data that needs to be grouped together, a for loop is used to create tuple lists. Lists are more adaptable than tuples due to their ability to be modified. This tutorial demonstrates creating a list of tuples using a for loop, simplifying repetitive tasks. Syntax for variable in iterable: # loop code Basic Operations on Tuples Example # Initializing my_tuple = ... Read More
![Atharva Shah](https://www.tutorialspoint.com/assets/profiles/626166/profile/60_735606-1679646268.png)
884 Views
This walkthrough is all about creating a dictionary of tuples in Python. This data structure stores key-value pairs. By combining dictionaries and tuples, a dictionary of tuples can be created. The benefit is organized and accessible data in a structured format. Becomes easy to represent multiple values for each key, such as student grades or contact information. Let us see how this efficiently stores and retrieves complex data. Syntax Ensure Python is installed on your system for its simplicity and readability. Create a dictionary of tuples using the following syntax: dictionary_name = {key1: (value1_1, value1_2, ...), key2: ... Read More
![Atharva Shah](https://www.tutorialspoint.com/assets/profiles/626166/profile/60_735606-1679646268.png)
2K+ Views
In programming and data processing, an acronym is an abbreviated version of a sentence. Python is an effective language for constructing acronyms, simplifying tasks, and conveying larger sentences simply. This lesson shows how to make acronyms out of words using Python and some of its potential applications. Algorithm You need to install any additional packages to run the below codes. Start off with an empty string to hold the acronym. Using the split() function, divide the supplied sentence into distinct words. ... Read More
![Atharva Shah](https://www.tutorialspoint.com/assets/profiles/626166/profile/60_735606-1679646268.png)
2K+ Views
This tutorial is all about string slicing. This involves creating a new string using the first and last two characters of a given string. Examples include using string slicing to extract the first two characters of a string. Such as "he" and "lo, " and combining these slices to create a new string with the first and last two characters. String manipulation methods prove handy while working with large strings or performing specific operations on a string's individual components. Let us explore several ways to handle this. Algorithm Begin with the string that has ... Read More
![Atharva Shah](https://www.tutorialspoint.com/assets/profiles/626166/profile/60_735606-1679646268.png)
136 Views
In Python, creating a list of tuples is a flexible data structure for storing many items. Tuples are immutable, ordered collections that are suitable for grouping similar items. This tutorial will guide you through this with several examples to build and handle lists of tuples. Understanding Tuples Tuples are ordered collections of elements. Lists are mutable collections of elements enclosed in square brackets, that combine with tuples to form a list of tuples. List comprehension gives compact code. It also unpacks and assigns variables to each member necessary for quick access. Nesting tuples within lists ... Read More
![Sai Mohan Pulamolu](https://www.tutorialspoint.com/assets/profiles/692781/profile/60_2250576-1691574552.jpg)
217 Views
In Python, fetching characters with odd frequencies from a given string can be a very common task in text processing and data analysis. In this article, we will learn various methods to fetch the odd frequency characters of a string in Python. Using a Dictionary Dictionaries are very convenient when there is a need to keep track of the frequencies of elements Approach To get the odd frequency elements, We will iterate through the entire string, and for each character in the string, we will increment the character count in the dictionary. At the end of the iteration, we will ... Read More