Who is this book for? ?Anyone who wants to teach themselves computer programming, even if they have no previous experience programming. ?Kids and teenagers who want to learn computer programming by programming games. Kids as young as 9 or 10 years old should be able to follow along. ?Adults and teachers who wish to teach others programming. ?Programmers who want to teach others "real" programming by example. This book is available for free under a Attribution/Share-Alike Creative Commons license. You can make as many copies of it as you like, as long as credit to the author is left in. The Python programming language software this book teaches is also freely available from www.python.org. Table of Contents Chapter 1 - "Hello World!" - Your First Program x Hello! x Downloading and Installing Python x Starting the Python Interpreter x Some Simple Math Stuff x Evaluating Expressions x Variables x Strings x Writing Programs x Hello World! x The Difference Between Statements and Expressions x "My Favorite Stuff" x Crazy Answers and Crazy Names for our Favorite Stuff x Capitalizing our Variables x Chapter 2 - Guess the Number x Source Code x Arguments x Blocks x Conditions and Booleans x if Statements x Step by Step, One More Time x Some Changes We Could Make x What Exactly is Programming? x A Web Page for Program Tracing x Chapter 3 - Jokes x How Programs Run on Computers x Source Code x Some Other Escape Characters x Quotes and Double Quotes x Chapter 4 - Dragon Realm x Source Code x def Statements x Boolean Operators x Variable Scope x Parameters x Local Variables and Global Variables with the Same Name x Where to Put Function Defintions x The Colon : x Step by Step, One More Time x Designing the Program x A Web Page for Program Tracing x Chapter 5 - Hangman x ASCII Art x Source Code x Designing the Program x Multi-line Strings x Constant Variables x Lists x Changing the Values of List Items with Index Assignment x List Concatenation x The in Operator x Removing Items from Lists with del Statements x Lists of Lists x Methods x The len() Function x The range() Function x for Loops x Strings Act Like Lists x List Slicing and Substrings x elif ("Else If") Statements x And that's it! x Dictionaries x Sets of Words for Hangman x Chapter 6 - Tic Tac Toe x Source Code x Designing the Program x Game AI x List References x Short-Circuit Evaluation x The None Value x A Web Page for Program Tracing x Chapter 7 - Bagels x Source Code x Augmented Assignment Operators x The sort() List Method x The join() String Method x String Interpolation x Chapter 8 - Sonar x Grids and Cartesian Coordinates x Negative Numbers x Changing the Signs x Absolute Values x Coordinate System of a Computer Monitor x Source Code x Designing the Program x The remove() List Method x Chapter 9 - Caesar Cipher x About Cryptography x ASCII, and Using Numbers for Letters x The chr() and ord() Functions x Source Code x The isalpha() String Method x The isupper() and islower() String Methods x Cryptanalysis x Brute Force x Chapter 10 - Reversi x How to Play Reversi x Source Code x The bool() Function x The random.shuffle() Function x Tips for Inventing Your Own Games x Chapter 11 - AI Simulation x "Computer vs. Computer" Games x Percentages x Integer Division x The round() Function x Learning New Things by Running Simulation Experiments x
- 粉丝: 168
- 资源: 2144
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助