python 学习笔记1

Preface

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 uses a technique called instruction. Instruction is where I tell you to do a sequence of controlled exercises designed to build a skill through repetition. This technique works very well with beginners who know nothing and need to acquire basic skills before they can understand more complex topics. It’s used in everything from martial arts to music to even basic math and reading skills.

前言
这本简单的书是为了让你在节目中开始的。标题说,它是学习编写代码的硬方法,但它实际上不是。这仅仅是“硬”的方式,因为它使用了一种叫做指令的技术。指令是我告诉你做一系列的控制练习,旨在建立一个技能,通过重复。这项技术很好地与那些不懂的初学者学习,并且需要掌握基本的技能,才能理解更复杂的主题。它的东西,从武术到音乐,甚至基本的数学和阅读技能。

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. By the end of the book, you will have the tools needed to begin learning more complex programming topics. I like to tell people that my book gives you your “programming black belt.” What this means is that you know the basics well enough to now start learning programming.

If you work hard, take your time, and build these skills, you will learn to code.

这本书教你在Python中慢慢建立和通过实践和记忆技巧建立技能,然后运用他们越来越难的问题。到这本书的结尾,你将有必要开始学习更复杂的编程主题的工具。我喜欢告诉人们,我的书给你你的“编程黑带”,这意味着什么是你知道的基本知识,现在开始学习编程。
如果你努力工作,花你的时间,并建立这些技能,你将学习代码。

Acknowledgments

I would like to thank Angela for helping me with the first two versions of this book. Without her, I probably wouldn’t have bothered to finish it at all. She did the copy editing of the first draft and supported me immensely while I wrote it.I’d also like to thank Greg Newman for doing the cover art for the first two editions, Brian Shumate for early website designs, and all the people who read previous editions of this book and took the time to send me feedback and corrections.

致谢

我要感谢安吉拉帮助我与本书的前两个版本。没有她,我可能不会有麻烦,完成它。她做了份初稿编辑和支持我非常,是我写的。我还想感谢格雷戈纽曼为前两版做封面,布瑞恩舒马特早期的网站设计,和所有的人谁读这本书和以前的版本花时间送我反馈和更正。

The Hard Way Is Easier
With the help of this book, you will do the incredibly simple things that all programmers do to learn a programming 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 on to 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, and spotting differences. 
艰难的路更容易
在这本书的帮助下,你将做所有程序员做的非常简单的事情,学习一种编程语言:
1。每次锻炼。
2。类型中的每一个样品。
3。使它运行。
这是它。这将是非常困难的,第一,但坚持它。如果你通过这本书,并且每一个晚上都做一个或两个小时的练习,你将有一个良好的基础来继续另一本书。你可能不是真正的从这本书中学习“编程”,但你会学习的基础技能,你需要开始学习的语言,这本书的工作是教你的三个最基本的技能,开始程序员需要知道:阅读和写作,关注细节,并发现差异。
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 you 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.
注意细节
把坏程序员和优秀程序员分开的一个技巧是注意细节。在事实上,这是从任何行业中分离的好的坏的。没有注意到你工作的微小的细节,你就会错过你所创造的关键要素。在编程中,这你是如何结束的错误和难以使用的系统。通过这本书,并准确地复制每一个例子,你将训练你的大脑专注于你正在做的事情,因为你正在做这件事。
Spotting Differences
A very important skill—which 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 make mistakes. It’s inevitable; even seasoned programmers 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.
斑点差异
一个非常重要的技能,大多数程序员开发的时间-是视觉能力注意事物之间的差异。一个有经验的程序员可以带2块代码这是稍微不同的,并立即开始指出的差异。程序员发明了工具,使这更容易,但我们不会使用任何这些。你首先要训练你的大脑,你可以用这些工具。当你做这些练习时,输入每一个,你会犯错误。这是不可避免的,甚至是经验丰富的程序员做几个。你的工作就是把你所写的东西与你所需要的和固定的东西进行比较所有的差异。这样做的话,你会训练自己注意到错误,错误和其他问题。
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 two 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 eight hours because I feel like it and it’s fun. To me, repetitive practice is natural and is 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.
练习和坚持的一个注记
当你学习编程的时候,我正在学习如何弹吉他。我每天至少练习2个小时。我弹奏音阶,和弦,和至少一个小时的琶音和再学习音乐理论,视唱练耳,歌曲,和其他我能。一些天我学习吉他和音乐八个小时,因为我觉得它和它的乐趣。对我来说,重复练习是很自然的,只是如何学习。我知道你每天都要练习的东西都是好的,哪怕是那天我吸的(也就是常),也很难。不断尝试,最终它会更容易和有趣。
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.
当你学习这本书并继续进行编程时,请记住,任何值得做的事情都是困难的。也许你是那种害怕失败的人,所以你放弃了第一个困难的迹象。也许你从来没有学会自我约束,所以你不能做任何事情,“无聊。”也许你说你是“天才”,“所以你从不尝试任何可能让你显得愚蠢或不神童。也许你是有竞争力的,不公平的比较自己的人,像我这样的人,已经编程了20年以上。
Whatever your reason for wanting to quit, keep at it. Force yourself. If you run into a Study Drill 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.
不管你想放弃什么,都要坚持。强迫自己。如果你遇到了一个学习的练习,你不能做或是一个你不理解的课程,然后跳过它,然后再回头再回头。只是继续走,因为与编程有一件非常奇怪的事情发生。一开始,你会不会理解任何事情。这会很奇怪,就像学习任何人类语言一样。你会用言语来斗争,而不知道什么象征着什么,这一切都会很混乱。然后有一天,你的大脑会突然爆炸,你会突然“得到它”,如果你继续做这些练习,并一直试图了解他们,你会得到它。你可能不是一个主程序员,但你至少要了解如何编程工作。
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.
如果你在读这本书,每第三个句子都会翻转,因为你觉得我侮辱了你的智慧,那么我有三点建议给你:
1。不要看我的书。我没有为你写的。我写的人谁不知道一切。
2。在你之前先清空。你将有一个困难的时间从某人学习
如果你已经知道了一切。
3。去学习Lisp。我听到有人知道一切真像Lisp。
对于其他人来说,在这里学习,只要看一切,仿佛我微笑着,我有一个淘气的小闪烁在我的眼睛。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
该资源内项目源码是个人的课程设计、毕业设计,代码都测试ok,都是运行成功后才上传资源,答辩评审平均分达到96分,放心下载使用! ## 项目备注 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。 该资源内项目源码是个人的课程设计,代码都测试ok,都是运行成功后才上传资源,答辩评审平均分达到96分,放心下载使用! ## 项目备注 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值