没有合适的资源?快使用搜索试试~ 我知道了~
Learn Python the hard way, 3rd edition
5星 · 超过95%的资源 需积分: 10 22 下载量 177 浏览量
2014-06-26
20:39:01
上传
评论 1
收藏 774KB PDF 举报
温馨提示
试读
197页
学习python经典的经典书籍。作为看tutorial以外的参考。英文原本
资源推荐
资源详情
资源评论
http://learnpythonthehardway.org/book/[2/7/2013 1:35:18 PM]
Learn Python The Hard Way,
3rd Edition
Welcome to the 3rd Edition of Learn Python the hard way. You can visit the companion site to the book at
http://learnpythonthehardway.org/ where you can purchase digital downloads and paper versions of the book. The free
HTML version of the book is available at http://learnpythonthehardway.org/book/.
Table Of Contents
The Hard Way Is Easier
Exercise 0: The Setup
Exercise 1: A Good First Program
Exercise 2: Comments And Pound Characters
Exercise 3: Numbers And Math
Exercise 4: Variables And Names
Exercise 5: More Variables And Printing
Exercise 6: Strings And Text
Exercise 7: More Printing
Exercise 8: Printing, Printing
Exercise 9: Printing, Printing, Printing
Exercise 10: What Was That?
Exercise 11: Asking Questions
Exercise 12: Prompting People
Exercise 13: Parameters, Unpacking, Variables
Exercise 14: Prompting And Passing
Exercise 15: Reading Files
Exercise 16: Reading And Writing Files
Exercise 17: More Files
Exercise 18: Names, Variables, Code, Functions
Exercise 19: Functions And Variables
Exercise 20: Functions And Files
Exercise 21: Functions Can Return Something
Exercise 22: What Do You Know So Far?
Exercise 23: Read Some Code
Exercise 24: More Practice
Exercise 25: Even More Practice
Exercise 26: Congratulations, Take A Test!
Exercise 27: Memorizing Logic
Exercise 28: Boolean Practice
Exercise 29: What If
http://learnpythonthehardway.org/book/[2/7/2013 1:35:18 PM]
Exercise 30: Else And If
Exercise 31: Making Decisions
Exercise 32: Loops And Lists
Exercise 33: While Loops
Exercise 34: Accessing Elements Of Lists
Exercise 35: Branches and Functions
Exercise 36: Designing and Debugging
Exercise 37: Symbol Review
Exercise 38: Doing Things To Lists
Exercise 39: Dictionaries, Oh Lovely Dictionaries
Exercise 40: Modules, Classes, And Objects
Exercise 41: Learning To Speak Object Oriented
Exercise 42: Is-A, Has-A, Objects, and Classes
Exercise 43: Gothons From Planet Percal #25
Exercise 44: Inheritance Vs. Composition
Exercise 45: You Make A Game
Exercise 46: A Project Skeleton
Exercise 47: Automated Testing
Exercise 48: Advanced User Input
Exercise 49: Making Sentences
Exercise 50: Your First Website
Exercise 51: Getting Input From A Browser
Exercise 52: The Start Of Your Web Game
Advice From An Old Programmer
Next Steps
Common Student Questions
How long does this course take?
You should take as long as it takes to get through it, but focus on doing work every day. Some people take about 3
months, others 6 months, and some only a week. I can do it in about 4 hours or less if I hurry and don't do the extra
credits.
What kind of computer do I need?
You can do it on most any computer. It works on Windows, Mac OSX, and Linux with instructions for all three in the
first exercise.
The Hard Way Is Easier
http://learnpythonthehardway.org/book/intro.html[2/7/2013 2:25:38 PM]
The Hard Way Is Easier
This simple book is meant to get you started in programming. The title says it's the hard way to learn to write code; but
it's actually not. It's only the "hard" way because it's the way people used to teach things using instruction. This book
instructs you in Python by slowly building and establishing skills through techniques like practice and memorization, then
applying them to increasingly difficult problems.
With the help of this book, you will do the incredibly simple things that all programmers need to do to learn a language:
1. Go through each exercise.
2. Type in each sample exactly.
3. Make it run.
That's it. This will be very difficult at first, but stick with it. If you go through this book, and do each exercise for one or
two hours a night, you will have a good foundation for moving onto another book. You might not really learn
"programming" from this book, but you will learn the foundation skills you need to start learning the language.
This book's job is to teach you the three most essential skills that a beginning programmer needs to know: Reading and
Writing, Attention to Detail, Spotting Differences.
Reading and Writing
It seems stupidly obvious, but, if you have a problem typing, you will have a problem learning to code. Especially if you
have a problem typing the fairly odd characters in source code. Without this simple skill you will be unable to learn even
the most basic things about how software works.
Typing the code samples and getting them to run will help you learn the names of the symbols, get familiar with typing
them, and get you reading the language.
Attention to Detail
The one skill that separates bad programmers from good programmers is attention to detail. In fact, it's what separates
the good from the bad in any profession. Without paying attention to the tiniest details of your work, you will miss key
elements of what you create. In programming, this is how you end up with bugs and difficult-to-use systems.
By going through this book, and copying each example exactly, you will be training your brain to focus on the details of
what you are doing, as you are doing it.
Learn Python The Hard Way
The Hard Way Is Easier
http://learnpythonthehardway.org/book/intro.html[2/7/2013 2:25:38 PM]
Spotting Differences
A very important skill -- that most programmers develop over time -- is the ability to visually notice differences between
things. An experienced programmer can take two pieces of code that are slightly different and immediately start pointing
out the differences. Programmers have invented tools to make this even easier, but we won't be using any of these. You
first have to train your brain the hard way, then you can use the tools.
While you do these exercises, typing each one in, you will be making mistakes. It's inevitable; even seasoned
programmers would make a few. Your job is to compare what you have written to what's required, and fix all the
differences. By doing so, you will train yourself to notice mistakes, bugs, and other problems.
Do Not Copy-Paste
You must type each of these exercises in, manually. If you copy and paste, you might as well just not even do them.
The point of these exercises is to train your hands, your brain, and your mind in how to read, write, and see code. If you
copy-paste, you are cheating yourself out of the effectiveness of the lessons.
A Note On Practice And
Persistence
While you are studying programming, I'm studying how to play guitar. I practice it every day for at least 2 hours a day. I
play scales, chords, and arpeggios for an hour at least and then learn music theory, ear training, songs and anything
else I can. Some days I study guitar and music for 8 hours because I feel like it and it's fun. To me repetitive practice is
natural and just how to learn something. I know that to get good at anything you have to practice every day, even if I
suck that day (which is often) or it's difficult. Keep trying and eventually it'll be easier and fun.
As you study this book, and continue with programming, remember that anything worth doing is difficult at first. Maybe
you are the kind of person who is afraid of failure so you give up at the first sign of difficulty. Maybe you never learned
self-discipline so you can't do anything that's "boring". Maybe you were told that you are "gifted" so you never attempt
anything that might make you seem stupid or not a prodigy. Maybe you are competitive and unfairly compare yourself to
someone like me who's been programming for 20+ years.
Whatever your reason for wanting to quit, keep at it. Force yourself. If you run into an Extra Credit you can't do, or a
lesson you just do not understand, then skip it and come back to it later. Just keep going because with programming
there's this very odd thing that happens.
At first, you will not understand anything. It'll be weird, just like with learning any human language. You will struggle with
words, and not know what symbols are what, and it'll all be very confusing. Then one day BANG your brain will snap
and you will suddenly "get it". If you keep doing the exercises and keep trying to understand them, you will get it. You
might not be a master coder, but you will at least understand how programming works.
The Hard Way Is Easier
http://learnpythonthehardway.org/book/intro.html[2/7/2013 2:25:38 PM]
If you give up, you won't ever reach this point. You will hit the first confusing thing (which is everything at first) and then
stop. If you keep trying, keep typing it in, trying to understand it and reading about it, you will eventually get it.
But, if you go through this whole book, and you still do not understand how to code, at least you gave it a shot. You can
say you tried your best and a little more and it didn't work out, but at least you tried. You can be proud of that.
A Warning For The Smarties
Sometimes people who already know a programming language will read this book and feel I'm insulting them. There is
nothing in this book that is intended to be interpreted as condescending, insulting, or belittling. I simply know more about
programming than my intended readers. If you think you are smarter than me then you will feel talked down to and
there's nothing I can do about that because you are not my intended reader.
If you are reading this book and flipping out at every third sentence because you feel I'm insulting your intelligence, then
I have three points of advice for you:
1. Stop reading my book. I didn't write it for you. I wrote it for people who don't already know everything.
2. Empty before you fill. You will have a hard time learning from someone with more knowledge if you already know
everything.
3. Go learn Lisp. I hear people who know everything really like Lisp.
For everyone else who's here to learn, just read everything as if I'm smiling and I have a mischievous little twinkle in my
eye.
License
This book is Copyright (C) 2010 by Zed A. Shaw.
Special Thanks
I'd like to thank a few people who helped with this edition of the book. First is my editor at Pretty Girl Editing Services
who helped me edit the book and is just lovely all by herself. Then there's Greg Newman, who did the cover jacket and
artwork, plus reviewed copies of the book. His artwork made the book look like a real book, and didn't mind that I totally
forgot to give him credit in the first edition. I'd also like to thank Brian Shumate for doing the website landing page and
other site design help, which I need a lot of help on.
Finally, I'd like to thank the hundreds of thousands of people who read the first edition and especially the ones who
submitted bug reports and comments to improve the book. It really made this edition solid and I couldn't have done it
without all of you. Thank you.
剩余196页未读,继续阅读
资源评论
- zhangqian__semmes2014-07-11很好的教程!谢谢分享!
leavesjjj
- 粉丝: 1
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 筷手引流工具.apk
- 论文(最终)_20240430235101.pdf
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功