PY THON - Programmer Books

2y ago
132 Views
51 Downloads
5.38 MB
562 Pages
Last View : 2m ago
Last Download : 2m ago
Upload by : Madison Stoltz
Transcription

PY THONLEARN PYTHON—FAST!In the first half of the book, you’ll learn about basicprogramming concepts, such as lists, dictionaries,classes, and loops, and practice writing clean andreadable code with exercises for each topic. You’llalso learn how to make your programs interactiveand how to test your code safely before adding it toa project. In the second half of the book, you’ll putyour new knowledge into practice with three substantialprojects: a Space Invaders–inspired arcade game, datavisualizations with Python’s super-handy libraries, and asimple web app you can deploy online.As you work through Python Crash Course, you’ll learnhow to: Use powerful Python libraries and tools, includingmatplotlib, NumPy, and Pygal Make 2D games that respond to keypresses andmouse clicks, and that grow more difficult as thegame progresses Work with data to generate interactive visualizations Create and customize simple web apps and deploythem safely online Deal with mistakes and errors so you can solve yourown programming problemsIf you’ve been thinking seriously about digging intoprogramming, Python Crash Course will get you up tospeed and have you writing real programs fast. Whywait any longer? Start your engines and code!ABOUT THE AUTHOREric Matthes is a high school science and math teacherliving in Alaska, where he teaches an introductoryPython course. He has been writing programs since hewas five years old.COVERS PYTHON 2 AND 3PY THON CR A SH COURSEPython Crash Course is a fast-paced, thorough introduction to programming with Python that will have youwriting programs, solving problems, and making thingsthat work in no time.T H E F I N E ST I N G E E K E N T E RTA I N M E N T “ I L I E F L AT .” 39.95 ( 45.95 CDN)SHELVE IN:PROGRAMMING LANGUAGES/PYTHONThis book uses RepKover — a durable binding that won’t snap shutMATTHESw w w.nostarch.comCR ASH COURSEAH A N D S - O N , P R O J E C T - B A S E DI N T R O D U C T I O NT OP R O G R A M M I N GERIC MAT THES

Python Crash Course

PythonCrash CourseA Hands-On, Project-BasedIntroduction to Programmingb y E r ic M a t t h e sSan Francisco

Python Crash Course. Copyright 2016 by Eric Matthes.All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,electronic or mechanical, including photocopying, recording, or by any information storage or retrievalsystem, without the prior written permission of the copyright owner and the publisher.First printing19 18 17 16 15   1 2 3 4 5 6 7 8 9ISBN-10: 1-59327-603-6ISBN-13: 978-1-59327-603-4Publisher: William PollockProduction Editor: Riley HoffmanCover Illustration: Josh EllingsonInterior Design: Octopod StudiosDevelopmental Editors: William Pollock, Liz Chadwick, and Leslie ShenTechnical Reviewer: Kenneth LoveCopyeditor: Anne Marie WalkerCompositor: Riley HoffmanProofreader: James FraleighFor information on distribution, translations, or bulk sales, please contact No Starch Press, Inc. directly:No Starch Press, Inc.245 8th Street, San Francisco, CA 94103phone: 415.863.9900; info@nostarch.comwww.nostarch.comLibrary of Congress Cataloging-in-Publication DataMatthes, Eric, 1972Python crash course : a hands-on, project-based introduction to programming / by Eric Matthes.pages cmIncludes index.Summary: "A project-based introduction to programming in Python, with exercises. Covers generalprogramming concepts, Python fundamentals, and problem solving. Includes three projects - how tocreate a simple video game, use data visualization techniques to make graphs and charts, and buildan interactive web application"-- Provided by publisher.ISBN 978-1-59327-603-4 -- ISBN 1-59327-603-61. Python (Computer program language) I. Title.QA76.73.P98M38 2015005.13'3--dc232015018135No Starch Press and the No Starch Press logo are registered trademarks of No Starch Press, Inc. Otherproduct and company names mentioned herein may be the trademarks of their respective owners. Ratherthan use a trademark symbol with every occurrence of a trademarked name, we are using the names onlyin an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of thetrademark.The information in this book is distributed on an “As Is” basis, without warranty. While every precautionhas been taken in the preparation of this work, neither the author nor No Starch Press, Inc. shall have anyliability to any person or entity with respect to any loss or damage caused or alleged to be caused directly orindirectly by the information contained in it.

About the AuthorEric Matthes is a high school science and math teacher living in Alaska,where he teaches an introductory Python course. He has been writingprograms since he was five years old. Eric currently focuses on writing software that addresses inefficiencies in education and brings the benefits ofopen source software to the field of education. In his spare time he enjoysclimbing mountains and spending time with his family.About the Technical ReviewerKenneth Love has been a Python programmer and teacher for many years.He has given talks and tutorials at conferences, done professional trainings, been a Python and Django freelancer, and now teaches for an onlineeducation company. Kenneth is also the co-creator of the django-bracespackage, which provides several handy mixins for Django’s class-basedviews. You can keep up with him on Twitter at @kennethlove.

For my father, who always made time toanswer my questions about programming,and for Ever, who is just beginning to ask mehis questions

Brief ContentsAcknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxviiIntroduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxixPart I: Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Chapter 1: Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Chapter 2: Variables and Simple Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Chapter 3: Introducing Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37Chapter 4: Working with Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53Chapter 5: if Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75Chapter 6: Dictionaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95Chapter 7: User Input and while Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117Chapter 8: Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133Chapter 9: Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161Chapter 10: Files and Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189Chapter 11: Testing Your Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215Part II: Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231Project 1: Alien InvasionChapter 12: A Ship That Fires Bullets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235Chapter 13: Aliens! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265Chapter 14: Scoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291

Project 2: Data VisualizationChapter 15: Generating Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321Chapter 16: Downloading Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349Chapter 17: Working with APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377Project 3: Web ApplicationsChapter 18: Getting Started with Django . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397Chapter 19: User Accounts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427Chapter 20: Styling and Deploying an App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455Afterword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483Appendix A: Installing Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485Appendix B: Text Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491Appendix C: Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499Appendix D: Using Git for Version Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515x   Brief Contents

Conte nt s in De ta ilAcknowledgmentsxxviiIntroductionxxixWho Is This Book For? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxWhat Can You Expect to Learn? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxWhy Python? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxiPart I: Basics11Getting Started3Setting Up Your Programming Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Python 2 and Python 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Running Snippets of Python Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Hello World! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Python on Different Operating Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Python on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Python on OS X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Python on Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Troubleshooting Installation Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Running Python Programs from a Terminal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .On Linux and OS X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .On Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 1-1: python.org . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 1-2: Hello World Typos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 1-3: Infinite Skills . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3. 4. 4. 4. 5. 5. 81015161616171717172Variables and Simple Data Types19What Really Happens When You Run hello world.py . . . . . . . . . . . . . . . . . . . . . . . . .Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Naming and Using Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Avoiding Name Errors When Using Variables . . . . . . . . . . . . . . . . . . . . . . . .Exercise 2-1: Simple Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 2-2: Simple Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Changing Case in a String with Methods . . . . . . . . . . . . . . . . . . . . . . . . . . .Combining or Concatenating Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Adding Whitespace to Strings with Tabs or Newlines . . . . . . . . . . . . . . . . . . .Stripping Whitespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Avoiding Syntax Errors with Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Printing in Python 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 2-3: Personal Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 2-4: Name Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 2-5: Famous Quote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19202121232323242526262829292929

Exercise 2-6: Famous Quote 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 2-7: Stripping Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Floats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Avoiding Type Errors with the str() Function . . . . . . . . . . . . . . . . . . . . . . . . . .Integers in Python 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 2-8: Number Eight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 2-9: Favorite Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .How Do You Write Comments? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .What Kind of Comments Should You Write? . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 2-10: Adding Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .The Zen of Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 2-11: Zen of Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3Introducing Lists37What Is a List? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Accessing Elements in a List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Index Positions Start at 0, Not 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Using Individual Values from a List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 3-1: Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 3-2: Greetings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 3-3: Your Own List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Changing, Adding, and Removing Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Modifying Elements in a List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Adding Elements to a List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Removing Elements from a List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 3-4: Guest List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 3-5: Changing Guest List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 3-6: More Guests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 3-7: Shrinking Guest List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Organizing a List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Sorting a List Permanently with the sort() Method . . . . . . . . . . . . . . . . . . . . . .Sorting a List Temporarily with the sorted() Function . . . . . . . . . . . . . . . . . . . .Printing a List in Reverse Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Finding the Length of a List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 3-8: Seeing the World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 3-9: Dinner Guests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 3-10: Every Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Avoiding Index Errors When Working with Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 3-11: Intentional Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4Working with ListsLooping Through an Entire List . . . . . . . . . . . .A Closer Look at Looping . . . . . . . . .Doing More Work Within a for Loop .Doing Something After a for Loop . . .xii   Contents in 6

Avoiding Indentation Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Forgetting to Indent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Forgetting to Indent Additional Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Indenting Unnecessarily . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Indenting Unnecessarily After the Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Forgetting the Colon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 4-1: Pizzas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 4-2: Animals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Making Numerical Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Using the range() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Using range() to Make a List of Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . .Simple Statistics with a List of Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . .List Comprehensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 4-3: Counting to Twenty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 4-4: One Million . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 4-5: Summing a Million . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 4-6: Odd Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 4-7: Threes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 4-8: Cubes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 4-9: Cube Comprehension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Working with Part of a List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Slicing a List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Looping Through a Slice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Copying a List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 4-10: Slices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 4-11: My Pizzas, Your Pizzas . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 4-12: More Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Tuples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Defining a Tuple . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Looping Through All Values in a Tuple . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Writing over a Tuple . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 4-13: Buffet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Styling Your Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .The Style Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Indentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Line Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Blank Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Other Style Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 4-14: PEP 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 4-15: Code Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5if StatementsA Simple Example . . . . . . . . . . . . . . . . . . . . . . . . .Conditional Tests . . . . . . . . . . . . . . . . . . . . . . . . . .Checking for Equality . . . . . . . . . . . . . . . .Ignoring Case When Checking for Equality .Checking for Inequality . . . . . . . . . . . . . . .Numerical Comparisons . . . . . . . . . . . . . .Checking Multiple Conditions . . . . . . . . . .Checking Whether a Value Is in a List . . . . 80Contents in Detail   xiii

Checking Whether a Value Is Not in a List . . . . . . . . . . . . . . . . . . . . . . . . . .Boolean Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 5-1: Conditional Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 5-2: More Conditional Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .if Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Simple if Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .if-else Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .The if-elif-else Chain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Using Multiple elif Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Omitting the else Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Testing Multiple Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 5-3: Alien Colors #1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 5-4: Alien Colors #2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 5-5: Alien Colors #3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 5-6: Stages of Life . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 5-7: Favorite Fruit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Using if Statements with Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Checking for Special Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Checking That a List Is Not Empty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Using Multiple Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 5-8: Hello Admin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 5-9: No Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Exercise 5-10: Checking Usernames . . . . . . . . . . . . . . . . .

PYTHON 39.95 ( 45.95 CDN) FAST! LEARN PYTHON—— PYTHON CRASH COURSE PYTHON CRASH COURSE MATTHES COVERS PYTHON 2 AND 3 Python Crash Course is a fast-paced, thorough intro-duction to programming with Python that will have you writing programs,

Related Documents:

THON merch will also be available online at store.thon.org. All profits ben-efit THON. Committee applications close Friday, Sept. 20, and many THON organizations are still open to those who want to join. Looking to the future, THON will host its THON 5K on Oct. 13, the 100 Days Til THON

finally got to our 8th grade Walk-A-Thon, we were thrilled! So far, the walk-a-thon has been my favorite event in 8th grade, and we made such unforgettable and wonderful memories! Page 4 2016 WALK-A-THON NICOLE LUBI-17, Issue 1 On October 6th, the Class of 2017 partici-pated in their last Walk-A-Thon at St. Augustine. All of the the 8th .

Updated October 2022 Page 1 HOW TO HOST A BY THE PEOPLE TRANSCRIBE-A-THON What's a transcribe-a-thon? By the People invites you to contribute to public knowledge by transcribing Library of Congress digital collections at crowd.loc.gov. This is a guide for how (and why) to run a By the People transcribing event. A transcribe-a-thon can be.

submitted by Anne Beard . winner of the state 4-H Sewing Skill-a-thon in the senior division. Kenton County Green Junior 4-H Skill-a-thon team took first place in the junior division. Webster County Junior 4-H Skill-a-thon

Programmer Programmer / Senior Programmer System Developer Interested parties, please forward your resume in WORD FORMAT to us by email: recruit@crcltd.com.hk or fax to 2528-9091. The information provided by can

CK-100 key programmer CTK058-03 76.30 AT89C51CC03UA-UM Chip with 1024 Tokens for CK100 key programmer (MOQ: 5pcs) CTK058 60.00 Super AD900 key programmer CTK033 105.00 CN900 Transponder key programmer (OEM version) CTK045 243.00 ND900 Transponder universal key programmer (OEM version) CTK047 243.00

Tiny AVR Programmer PGM-11801 15.95 98 Favorited Favorite 71 Wish List The Tiny AVR Programmer is a general AVR programmer, but it's specifically designed to allowq uick-and-easy programming of ATtiny85's (as well as 45's) compared to the pocket AVR programmer. It has an on-board socket, where the little 8-pin IC can be plugged in and directly .

the 2.4 GHz Wireless Programmer to your laptop or desktop computer via a USB connection. Description The Programmer functions as the interface between wireless hearing aids and computer fi tting software. The Programmer consists of two components: a Docking Station and a Dongle. Installation 1. Confi rm that Inspire X 2014.2 or higher is installed.