Basic Programming: Data Types
DOI link for Basic Programming: Data Types
Basic Programming: Data Types book
As said in the previous chapter, some data structures are shared between different computer languages, but some of them are language specific. That is why data types somehow define a computer language. Python has its own characteristic data types. One such fundamental data structure is a sequence. Inside sequence, we
have those data types having a sequential order. A well-known example is the string which is nothing other than an ordered sequence of characters. Other sequences are lists and tuples.1 Although fundamental differences exist between these types of sequences, they share common properties. Sequence elements have an order, can be indexed, can be sliced, and can be iterated. Don’t worry if you don’t understand some of these terms. Just keep on reading. We’ll see all these points during this chapter. Apart from sequences, there are also unordered data types: dictionaries
and sets. A dictionary2 stores relationships between a key and a value, while a set is just an unordered collection of values. The next pages are focused on ordered (string, list, and tuple) and unordered types (dictionary and set).