...Chapter 6 Basic data structures A data structure, sometimes called data type, can be thought of as a category of data. Integer is a data category which can only contain integers. String is a data category holding only strings. A data structure not only defines what elements it may contain, it also supports a set of operations on these elements, such as addition or multiplication. Strings and numbers are the core data structures in Python. In this chapter, you’ll see a few more, almost as important, data structures. In the next chapter, you’ll se how you can design your own, customary data structures. The concept of a sequence is so fundamental to programming that I’ve had a very hard time avoiding it so far. And as you, alert and perky, have noticed, I actually haven’t, since I involuntarily had to introduce sequences in Section 4.4 when talking about the for loop. In Python, the word “sequence” covers several phenomena. Strings are sequences of characters, and you heard about those in Chapter 3. In the coming sections, you’ll hear about the two other basic types of sequence supported by Python: Lists and tuples. Later in this chapter, we’ll get around to talking about sets and dictionaries. Strings and integers represent concrete data objects; a string or a number represents true data in itself.1 Lists, tuples and dictionaries are designed to organize other data, to impose structure upon it; they do not necessarily represent true data in their own right. For this reason, they...
Words: 18297 - Pages: 74
...F u r t h e r Praise for Globalization and Its Discontents " Development and economics are not about statistics. Rather, they a re about lives and jobs. Stiglitz never forgets that there are people at t he end of these policies, and that the success of a policy should be d efined not by h o w fast international banks are repaid, but by h o w m u c h people have to eat, and by h o w much better it makes their lives." — Christian Science Monitor " [An] urgently important new book." — Boston Globe " Whatever your opinions, you will be engaged by Stiglitz's sharp i nsights for a provocative reform agenda to reshape globalization. A m ust read for those concerned about the future, w h o believe that a w orld of decent work is possible and want to avert a collision course b etween the haves and the have nots." —Juan Somavia, d irector-general of the International Labour Organization " [Stiglitz s] rare mix of academic achievement and policy experience m akes Globalization and Its Discontents w orth r e a d i n g . . . . His passion a nd directness are a breath of fresh air given the usual circumlocutions of economists." — BusinessWeek " T h i s smart, provocative study contributes significantly to the o n g o i n g globalization debate and provides a m o d e l of analytical r igor c o n c e r n i n g the process of assisting countries facing the challenges of e c o n o m i c development and transformation. . . . Impassioned, balanced and i n f...
Words: 144836 - Pages: 580