Home | | Computer Science 12th Std | Python Lists, Tuples, Sets And Dictionary: Points to remember

Chapter: 12th Computer Science : Chapter 9 : Python Modularity and OOPS : Lists, Tuples, Sets And Dictionary

Python Lists, Tuples, Sets And Dictionary: Points to remember

Python programming language has four collections of data types such as List, Tuple, Set and Dictionary.

Points to remember:


·        Python programming language has four collections of data types such as List, Tuple, Set and Dictionary.

 

·        A list is known as a “sequence data type”. Each value of a list is called as element.

 

·        The elements of list should be specified within square brackets.

 

·        Each element has a unique value called index number begins with zero.

 

·        Python allows positive and negative values as index.

 

·        Loops are used access all elements from a list.

 

·        The “for” loop is a suitable loop to access all the elements one by one.

 

·        The append ( ), extend ( ) and insert ( ) functions are used to include more elements in a List.

 

·        The del, remove ( ) and pop ( ) are used to delete elements from a list.

 

·        The range ( ) function is used to generate a series of values.

 

·        Tuples consists of a number of values separated by comma and enclosed within parentheses.

 

·        Iterating tuples is faster than list.

 

·        The tuple ( ) function is also used to create Tuples from a list.

 

·        Creating a Tuple with one element is called “Singleton” tuple.

 

·        A Set is a mutable and an unordered collection of elements without duplicates.

 

·        A set is created by placing all the elements separated by comma within a pair of curly brackets.

 

·        A dictionary is a mixed collection of elements.

 

Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
12th Computer Science : Chapter 9 : Python Modularity and OOPS : Lists, Tuples, Sets And Dictionary : Python Lists, Tuples, Sets And Dictionary: Points to remember |


Privacy Policy, Terms and Conditions, DMCA Policy and Compliant

Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.