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

11K+ Views
Python variable is a name that you give to something in your program. It basically helps you keep track of objects, which are things like numbers, words or any other data. When you assign an object to a variable, you can use that name to refer to that object later. The data, on the other hand, is still contained within the object. For example, a is assigned the value 100. Here 'a' is a variable. a = 100 This assignment creates an integer object with the value 100 and assigns the variable a to point to that object. In ... Read More

4K+ Views
In this article, we will see the differences between two common ways of adding elements to lists in Python: the append method and the "+" operator. The append() method is used to add elements to the list by utilizing a mutator() method. The '+' operator is used to create a new list with the capacity for one more element. Behaviour of "+" with Python Lists Python accesses each element of the first list by using the '+' operator. When the '+' symbol is used, a new list with the capacity for one more element is produced. The old ... Read More

16K+ Views
Sequence Data Types are used to store data in containers in the Python programming language. The different types of containers used to store the data are List, Tuple, and String. Lists are mutable and can hold data of any type, whereas Strings are immutable and can only store data of the str type. Tuples are immutable data types that can store any sort of value. So let's discuss these data types one by one in the coming section - List The sequential data-type class includes the list data type. The list is the only mutable data type in the sequential ... Read More

5K+ Views
Lists are one of the four most commonly used data structures provided by Python. A list is a data structure in Python that is mutable and has an ordered sequence of elements. In Python, a list is like a box in which you can keep many things like numbers, names, or your favorite fruits. Let us say you have a list like this: fruits = ["apple", "banana", "mango"] Here, each fruit has a position in the list. But in Python, we start counting from 0, not 1. So here is the indexing of apple, banana, and mango - ... Read More

3K+ Views
We are accustomed to using the * symbol to represent multiplication, but when the operand on the left side of the * is a list, it becomes the repetition operator. The repetition operator makes multiple copies of a list and joins them all together. Lists can be created using the repetition operator, *. For example, Examplenumbers = [0] * 5 print numbersOutputThis will give the output −[0, 0, 0, 0, 0][0] is a list with one element, 0. The repetition operator makes 5 copies of this list and joins them all together into a single list. Another example using multiple ... Read More

19K+ Views
The in operator in Python In Python, the in operator determines whether a given value is a constituent element of a sequence such as a string, array, list, or tuple. When used in a condition, the statement returns a Boolean result of True or False. The statement returns True if the specified value is found within the sequence. When it is not found, we get a False. In Python, a list is an ordered sequence that can hold several object types such as integer, character, or float. In other programming languages, a list is equivalent to an array. Square brackets ... Read More

17K+ Views
In Python, a list is an ordered sequence that can hold several object types such as integer, character, or float. In other programming languages, a list is equivalent to an array. In this article, we will show you how the * operator works on a list in python. So we will show you different examples to understand how * works on a python list in the below section − Repetition Operator(*) A repetition operator is supported by sequence datatypes (both mutable and immutable). The repetition operator * creates several copies of that object and joins them together. When used with ... Read More

2K+ Views
In Python, a list is an ordered sequence that can hold several object types such as integer, character, or float. In other programming languages, a list is equivalent to an array. Square brackets are used to denote it, and a comma (, ) is used to divide two items in the list. In this article, we will show you how to sort the objects and elements in a list using python. Below are the different methods to accomplish this task − Using sort() method Using sorted() method Assume we have taken a list containing some elements. We will ... Read More

20K+ Views
List is one of the most commonly used data structures provided by python. List is a data structure in Python that is mutable and has an ordered sequence of elements. In this article, we will discuss how to add objects to a list and the different ways to add objects, such as append(), insert(), and extend() methods, in Python. Using append() method In this method, we use append() to add objects to a list. The append() method adds a new element to the end of a list that already exists. Example 1 In this example, we used the append() method ... Read More

3K+ Views
A list is one of the most commonly used data structures in Python. It is mutable and has an ordered sequence of elements. In this article, we will find the element from a given list with the minimum value. We will see different examples and different ways to do this. But first, let us see how do define a list in Python. Defining a List Following is a list of integer values - lis= [12, 22, 32, 54, 15] print(lis) When you run the program, it will show this output - [12, 22, 32, 54, 15] In this article, ... Read More