- 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 9369 Articles for Python
Updated on 17-Feb-2023 14:26:38
In this article, we will be discussing how to sort a tuple by values in Python. A tuple is a data structure that is similar to a list, but it is immutable, meaning that once it is created, we cannot change the values of the elements within it. Example Following is an example to create a tuple – tple = ("Hello", "world", "hi") print(tple) Output (“Hello”, “world”, “hi”) Ordered, immutable triple items can have multiple values. An index of [0] is assigned to the first item in a triple, [1] to the second, and so on. When we ... Read More
Updated on 17-Feb-2023 14:25:35
In this article, we will be discussing how to remove duplicate elements from a dictionary in Python. A dictionary is a data structure that stores key-value pairs, and it is an essential data type to understand when learning Python. However, there may be cases where we have a dictionary with duplicate elements, and we want to remove them to clean up the data. We can declare a dictionary in the following way − thisdict = { "brand": "Ford" , "model": "Mustang" , "year": 1964 } However, a dictionary can contain duplicate value for different keys, but we might ... Read More
Updated on 17-Feb-2023 14:24:30
In Python, tuples are a useful data type for storing a collection of items. Sometimes, it may be necessary to print the keys and values of a tuple in order to understand or debug your code. In this article, we will be discussing, how to print the keys and values of a tuple in Python. We will go over the syntax for accessing these elements and will provide examples of how to do so. First, we will learn about what is tuple and what we mean by the keys and values of the tuple. What does a Python tuple mean? ... Read More
Updated on 17-Feb-2023 14:23:09
In Python, tuples are an important data type for storing a collection of items. Sometimes, it may be necessary to print the elements of a tuple in order to understand or debug your code. In this article, we will be discussing how to print the elements of a tuple in Python. We will go over the syntax for accessing and printing tuple elements and will provide examples of how to do so. We can define a tuple in the following way − tup1 = ("this" , "is" , “a” , "tuple") tup2 = (1, 2, 3, 4, 5 ); tup3 ... Read More
Updated on 17-Feb-2023 14:21:44
Tuples are an important data type in Python and are often used to store a fixed set of elements. In this article, we will be discussing how to extract the first and last elements from a tuple in Python. We will go over the syntax for accessing these elements and will provide examples of how to do so. What is a Tuple in Python? Tuples allow for the storage of several things in a single variable. One of python’s four built-in data types for storing data collections is the tuple. Unchangeable and ordered collections are called tuples. Round brackets are ... Read More
Updated on 17-Feb-2023 14:19:35
In Python, a tuple is an immutable sequence type that is commonly used to store a collection of items. A python tuple is very similar to a list in python in terms of nesting, indexing and repetition but one difference is that a tuple is immutable whereas the list is mutable which means we can change the elements of a list but we cannot do the same with a tuple. One other difference is that list uses the square bracket [] for declaration but tuples use simple bracket (). In this article, we will be discussing how to create a ... Read More
Updated on 17-Feb-2023 14:17:56
Dictionaries are a powerful data type in Python that allow you to store data as key-value pairs. In this article, we will be discussing how to compare elements in two dictionaries in Python. We will go over the syntax for comparing dictionary elements and will provide examples of how to do so. Dictionaries in Python In Python, a dictionary can be created by placing a sequence of elements within curly { } brackets , separated by ‘comma’ ( , ). Dictionary holds pairs of values, one being the key and the other corresponding pair element being its value. Values ... Read More 
Updated on 01-Feb-2023 20:52:31
Integrated Development Environments (IDEs) are a crucial tool for software developers, and this is especially true for those working with the Python programming language. An IDE is a software application that provides a comprehensive environment for coding, debugging, and testing software. It typically includes a code editor, a compiler or interpreter, and a variety of other tools that help streamline the development process. In software companies, several popular IDEs are widely used for Python programming. Some of the most popular options include − PyCharm − This is one of the most popular IDEs for Python development, and it is ... Read More 
Updated on 01-Feb-2023 20:51:39
Splitting a text file in Python can be done in various ways, depending on the size of the file and the desired output format. In this article, we will discuss the fastest way to split a text file using Python, taking into consideration both the performance and readability of the code. split() method One of the most straightforward ways to split a text file is by using the built-in split() function in Python. Based on a specified delimiter this function splits a string into a list of substrings. For example, the following code splits a text file by newline characters ... Read More 
Updated on 01-Feb-2023 20:50:51
Scala and Python are both powerful programming languages that are widely used for a variety of applications. They have some similarities, such as being high-level programming languages, but they also have some important differences. Whether you are a beginner or an experienced developer, this article will provide you with a comprehensive understanding of the key differences between Scala and Python and help you make an informed decision on which language to use for your next project. Factors Scala Python Syntax Scala is a statically typed language, which means that variables must be declared with a specific ... Read More Advertisements