About the Author David Griffiths began programming at age 12, after being inspired by a documentary on the work of Seymour Papert. At age 15 he wrote an implementation of Papert's computer language LOGO. After studying Pure Mathematics at University, he began writing code for computers and magazine articles for humans and he currently works in the UK, helping people to create simpler, more valuable software. He spends his free time traveling and time with his lovely wife, Dawn. Paul Barry is formally educated and trained in Computer Science and holds a Masters Degree in Computing Science. He has been programming professionally, on and off, for close to 25 years. Paul already has two textbooks to his name, and is also a Contributing Editor to Linux Journal magazine. His day job is with the Institute of Technology, Carlow in Ireland where he has spent over a decade preparing Ireland's next generation of computing folk to be productive in the workforce. His role as a third level educator affords him the opportunity to explore, learn and teach the very latest programming technologies and practices, which is something that he enjoys even though he knows this makes him a bonafide "geek". Paul lives just outside the town of Carlow in Ireland with his wife, two sons, daughter, dog and cat. There's a bunch of computers and a growing collection of music instruments in the house, too (and like a lot of the Head First family, Paul is a struggling guitarist trapped inside a geek's body). He has so far resisted any suggestion that the family acquire a hamster ... or a set of drums. Looking for a reliable way to learn how to program on your own, without being overwhelmed by confusing concepts? Head First Programming introduces the core concepts of writing computer programs -- variables, decisions, loops, functions, and objects -- which apply regardless of the programming language. This book offers concrete examples and exercises in the dynamic and versatile Python language to demonstrate and reinforce these concepts. Learn the basic tools to start writing the programs that interest you, and get a better understanding of what software can (and cannot) do. When you're finished, you'll have the necessary foundation to learn any programming language or tackle any software project you choose. With a focus on programming concepts, this book teaches you how to: Understand the core features of all programming languages, including: variables, statements, decisions, loops, expressions, and operators Reuse code with functions Use library code to save time and effort Select the best data structure to manage complex data Write programs that talk to the Web Share your data with other programs Write programs that test themselves and help you avoid embarrassing coding errors. Contents Intro xxiii 1 Starting to Code: Finding Your Way 2 Textual Data: Every String Has Its Place 3 Functions: Lets Get Organized 4 Data Files and Arrays: Sort It Out 5 Hashes and Databases: Putting Data in Its Place 6 Modular Programming: Keeping Things Straight 7 Building a Graphical User Interface: Going All Gooey 8 GUIs and Data: Data Entry Widgets 8 1/2 Exceptions and Message Boxes: Get the Message? 9 Graphical Interface Elements: Selecting the Right Tool 10 Custom Widgets and Classes: With an Object in Mind Appendix i Leftovers: The Top Ten Things (We Didnt Cover) Looking for a reliable way to learn how to program on your own, without being overwhelmed by confusing concepts? Head First Programming introduces the core concepts of writing computer programs -- variables, decisions, loops, functions, and objects -- which apply regardless of the programming language. This book offers concrete examples and exercises in the dynamic and versatile Python language to demonstrate and reinforce these concepts. Learn the basic tools to start writing the programs that interest you, and get a better understanding of what software can (and cannot) do. When you're finished, you'll have the necessary foundation to learn any programming language or tackle any software project you choose.With a focus on programming concepts, this book teaches you how to:Understand the core features of all programming languages, including: variables, statements, decisions, loops, expressions, and operatorsReuse code with functionsUse library code to save time and effortSelect the best data structure to manage complex dataWrite programs that talk to the WebShare your data with other programsWrite programs that test themselves and help you avoid embarrassing coding errorsWe think your time is too valuable to waste struggling with new concepts. Using the latest research in cognitive science and learning theory to craft a multi-sensory learning experience, Head First Programming uses a visually rich format designed for the way your brain works, not a text-heavy approach that puts you to sleep. Table of Contents 11 Intro 25 Chapter 1. Starting to Code 37 Chapter 2. Textual Data 73 Chapter 3. Functions 113 Chapter 4. Data in Files and Arrays 149 Chapter 5. Hashes and Databases 181 Chapter 6. Modular Programming 213 Chapter 7. Building a Graphical User Interface 251 Chapter 8. Guis and Data 293 Chapter 8 陆. Exceptions and Message Boxes 329 Chapter 9. Graphical Interface Elements 349 Chapter 10. Custom Widgets and Classes 385 Appendix i: Leftovers 421 Index 433 Symbols 433 A 433 B 433 C 434 D 435 E 435 F 436 G 436 H 437 I 437 J 437 K 437 L 438 M 438 N 438 O 439 P 439 Q 440 R 440 S 440 T 441 U 442 V 442 W 442 First, excuse my English. Now that we have that clear, the book is highly dynamic and very effective, I have been trying to learn programming for a while now, I was always confused and lost interest because of it on the way, with this book, that will not happen, when you do the exercises and get them right you get highly motivated to keep going, I recommend this. Looking for a reliable way to learn how to program on your own, without being overwhelmed by confusing concepts? This book introduces the core concepts of writing computer programs - variables, decisions, loops, functions, and objects - which apply regardless of the programming language.