Sayantan's Blog On Python Programming

bappa.sayantan@gmail.com

LIST SORTING OPERATIONS

LIST SORTING OPERATIONS INTRODUCTIONS Python lists can be sorted either in forward or backward direction by using below methods: sort() FUNCTION sort() FUNCTION helps us to sort the list in ascending order. LIST SORTING OPERATIONS : Output LIST SORTING OPERATIONS : Output In the above example we have seen after calling sort() function the list …

LIST SORTING OPERATIONS Read More »

STEP SIZE IN PYTHON LIST SLICING

STEP SIZE IN PYTHON LIST SLICING INTRODUCTION Step size allows us to put filter on sliced data. POSITIVE STEP SIZE IN LIST SLICING Syntax : [start_index : end_index : setp_size] STEP SIZE IN PYTHON LIST SLICING : Output STEP SIZE IN PYTHON LIST SLICING : Output In the above example, we have used the complete …

STEP SIZE IN PYTHON LIST SLICING Read More »

PYTHON LIST SLICING OPERATION

PYTHON LIST SLICING OPERATION INTRODUCTION Before understanding slicing operation lets look at some list accessing methods by using index values. PYTHON LIST SLICING OPERATION : Output In the above example, we have used positive index as well as negative index. Negative index will be counted from the end of the list. In the above case, …

PYTHON LIST SLICING OPERATION Read More »

PYTHON LOGICAL OPERATORS

PYTHON LOGICAL OPERATORS INTRODUCTION PYTHON supports 3 logical operators: 1. AND2. OR3. NOT LOGICAL AND OPERATOR: LOGICAL AND OPERATOR returns TRUE if both the values are TRUE. Otherwise returns FALSE. PYTHON LOGICAL OPERATORS : Output PYTHON LOGICAL OPERATORS : Output PYTHON LOGICAL OPERATORS : Output LOGICAL OR OPERATOR: LOGICAL AND OPERATOR returns TRUE if any …

PYTHON LOGICAL OPERATORS Read More »

PYTHON ASSIGNMENT OPERATORS

PYTHON ASSIGNMENT OPERATORS INTRODUCTION: PYTHON ASSIGNMENT OPERATORS perform an operation and assign the result. ASSIGN OPERATOR (=): ASSIGN OPERATOR assign a value to a variable. It can be used with any data type. PYTHON ASSIGNMENT OPERATORS : Output ADD AND ASSIGN OPERATOR (+=): ADD AND ASSIGN OPERATORS add two values and assign the result to …

PYTHON ASSIGNMENT OPERATORS Read More »