Snake Wrangling for Kids - Learning to Program with Python 3, mac-v0.7.7 (2007).pdf

(1362 KB) Pobierz
Snake Wrangling for Kids - Learning to Program with Python
519336122.001.png
Snake Wrangling for Kids, Learning to Program with Python
by Jason R. Briggs
Version 0.7.7
Copyright c 2007.
Published by... ah, no one actually.
Cover art and illustrations by Nuthapitol C.
Thanks To:
Guido van Rossum (for benevelont dictatorship of the Python language), the mem-
bers of the Edu-Sig mailing list (for helpful advice and commentary), author David Brin
(the original instigator of this book), Michel Weinachter (for providing better quality
versions of the illustrations), and various people for providing feedback and errata,
including: Paulo J. S. Silva, Tom Pohl, Janet Lathan, Martin Schimmels, and Mike
Cariaso (among others). Anyone left o this list, who shouldn’t have been, is en-
tirely due to premature senility on the part of the author.
License:
This work is licensed under the Creative Commons Attribution-Noncommercial-
Share Alike 3.0 New Zealand License. To view a copy of this license, visit
Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
Below is a summary of the license.
You are free:
•to Share to copy, distribute and transmit the work
•to Remix to adapt the work
519336122.002.png
Under the following conditions:
Attribution. You must attribute the work in the manner specied by the author
or licensor (but not in any way that suggests that they endorse you or your
use of the work).
Noncommercial. You may not use this work for commercial purposes.
Share Alike. If you alter, transform, or build upon this work, you may distribute
the resulting work only under the same or similar license to this one.
For any reuse or distribution, you must make clear to others the license terms of
this work.
Any of the above conditions can be waived if you get permission from the copyright
holder.
Nothing in this license impairs or restricts the author’s moral rights.
519336122.003.png
Contents
v
1.1 A Few Words About Language . . . . . . . . . . . . . . . . . . . . . 2
. . . . . . . . . 3
1.3 Your rst Python program . . . . . . . . . . . . . . . . . . . . . . . . 4
9
2.1 Use of brackets and “Order of Operations” . . . . . . . . . . . . . . . 11
2.2 There’s nothing so ckle as a variable . . . . . . . . . . . . . . . . . . 13
2.3 Using Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.4 A Piece of String? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.5 Tricks with Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.6 Not quite a shopping list . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.7 Tuples and Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.8 Things to try . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.1 Things to try . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
33
4.1 Do this. . . or ELSE!!! . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
i
Zgłoś jeśli naruszono regulamin