Difference between revisions of "Python-datastructures"

From wikipost
Jump to navigationJump to search
Line 17: Line 17:
  
 
In these pages we mainly look at the most common data structures in python:
 
In these pages we mainly look at the most common data structures in python:
 
 
* lists
 
 
* dictionaries
 
 
* arrays
 
 
* tuples
 
 
 
 
  
  
Line 40: Line 28:
 
|details
 
|details
 
|-
 
|-
|Dictionary
+
|Tuple
|dictionaryexample
+
|('January', 'February')
 
|details
 
|details
 
|-
 
|-

Revision as of 07:02, 23 December 2020

"In computer science, a data structure is a data organization, management, and storage format that enables efficient access and modification. More precisely, a data structure is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data."

-- source: Wikipedia


Examples of data structures:

  • [61, 22, 53, 48, 27]
  • {"id": 324, "type": 4, "size": 19}


Python knows how to work with of several types of data structures without the need to import additional libraries. Sometimes you do need to import a library to provide support (e.g. json, csv, sql) but most of these are already available when you have python installed. In rare cases you may need to build or acquire a third-party library for data structure support.


In these pages we mainly look at the most common data structures in python:


Name Example Details
List listexample details
Tuple ('January', 'February') details
Array arrayexample details
Tuple tuple example details