LearnPython3theHardWay
byakki
这个作者很懒,什么都没留下…
展开
-
LearnPython3theHardWay__Excercise 46 A Project Skeleton
1原创 2019-03-04 11:35:46 · 185 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 38 Doing Things to Lists
&原创 2019-02-16 13:24:14 · 199 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 31 Making Decisions
建议ex27-31连起来学习原创 2019-02-08 15:35:47 · 247 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 30 Else and If
建议ex27-31连起来学习原创 2019-02-08 15:20:39 · 118 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 29 What If
建议ex27-31连起来学习原创 2019-02-08 15:02:27 · 145 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 28 Boolean Practice
建议ex27-31连起来学习布尔表达式的练习我们在IDLE里把下面的代码一行一行打出来并看结果,请先想想答案再按ENTERTrue and TrueFalse and True1 == 1 and 2 == 1"test" == "test"1 == 1 or 2 != 1True and 1 == 1False and 0 != 0True or 1 == 1"test" ...原创 2019-02-08 14:22:20 · 142 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 27 Memorizing Logic
建议ex27-31连起来学习今天开始学习逻辑True or False, 对于零基础的同学,要求做到一看到就能说出真或假,因为程序员每天都需要逻辑。作者建议我们弄个卡片,把相关词语写在上面,有空就拿出来看并立即说出真或假。我们用以下字符来判断 True 和 Falseandornot!= (not equal)== (equal)>= (greater-than-e...原创 2019-02-08 13:51:57 · 168 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 26 Congratulations,Take a Test!
我们学习的进度已经完成了一半了。接下来将来一个测验!修复下面的代码print("How old are you?", end=' ')age = input()print("How tall are you?", end=' ')print("How much do you weigh?", end=' 'weight = input()print(f"So, you're {ag...原创 2019-02-07 23:05:51 · 226 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 37 Symbol Review
原创 2019-02-15 16:34:13 · 147 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 36 Designing and Debugging
原创 2019-02-15 16:08:30 · 214 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 25 Even More Practice
这一节我们更多的练习函数编程。原创 2019-02-06 16:37:45 · 311 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 39 Dictionaries, Oh Lovely Dictionaries
**原创 2019-02-16 16:21:00 · 157 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 14 Prompting and Passing
知识点:argv input让我们做一个练习,用上 argv 和 input和简单的提示语。进行简单的人机交互。from sys import argvscript, user_name = argvprompt = '> 'print(f"Hi {user_name}, I'm the {script} script.")print("I'd like to ask you...原创 2019-01-31 09:47:37 · 273 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 45 You Make a Game
1原创 2019-03-04 10:24:14 · 279 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 44 Inheritance versus Composition
1原创 2019-03-02 15:36:40 · 187 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 43 Basic Object-Oriented Analysis and Design
1原创 2019-03-02 12:34:42 · 208 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 50 Your First Website
1原创 2019-03-05 11:15:46 · 157 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 47 Automated Testing
1原创 2019-03-05 10:00:24 · 217 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 33 While Loops
知识点:whilewhile循环,只要条件为真,就会一直循环下去。反复记忆:条件真,循环。我们用while循环就要注意,要设置一个“终点”,让条件变假,循环终止。不然就会形成死循环。为避免这种情况,有些规则我们要遵守:能用 for 就不用 while检查while语句,确保在某一时刻条件会变 False在while循环开始和结尾处都加个断点,如print一些变量,看看循环做了什么i ...原创 2019-02-14 09:25:32 · 120 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 32 Loops and Lists
知识点:for , range, list今天开始学 for 循环。在使用for之前,我们需要找个容器来存储循环后的结果。最好的方法就是用列表。首先,我们创建列表:hairs = ['brown', 'blond', 'red']eyes = ['brown', 'blue', 'green']weights = [1, 2, 3, 4]列表用中括号,把元素包起来现在我人产创建一些列...原创 2019-02-13 23:42:16 · 126 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 42 Is-A, Has-A, Objects, and Classes
原创 2019-02-18 00:28:27 · 333 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 41 Learning to Speak Object-Oriented
原创 2019-02-17 18:36:56 · 273 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 40 Modules, Classes, and Objects
原创 2019-02-17 01:52:11 · 190 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 24 More Practice
回顾一下我们学习了什么:print(),注释,算术运算,变量代入到print(),字符串的运算,格式化,转义字符,input(),文件的读写,函数编程def我们将结束第一阶段的学习。我们应该有足够的能力去更进一步了解程序是怎么执行的,但我们还需要更多更长的练习,为的是培养耐心。开始吧。边打边回顾学过的内容print("Let's practice everything.")print('Yo...原创 2019-02-05 22:35:03 · 183 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 23 Strings, Bytes, and Character Encodings
字符串,字节,和字符编码这一节篇幅非常非常的长。。。看得我头晕做这一节练习前,我们下载一个UTF-8编码的文本文件 languages.txt 。这个文件内容是人类的语言列表,可以告诉我们一些有趣的概念:现代计算机是怎么存储人类的语言,python3怎么调用这些字符串如何把python的字符串“编码”和“解码”为一种称为bytes的类型在操作字符串和字节时怎么处理错误怎样读代码和理...原创 2019-02-04 14:57:24 · 312 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 16 Reading and Writing Files
建议ex15-17连起来练习原创 2019-01-31 14:38:18 · 256 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 15 Reading Files
建议ex15-17连起来练习原创 2019-01-31 13:38:16 · 243 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 7 More Printing
更多的练习,是为了打好基础。开始吧!不要懒惰!不要复制粘贴!在这节练习,我们复习了 {}.format() 和字符串的“加法”(第20、21行),新接触了字符串的“乘法”(第4行)和第20行的print( i , end=’ ')print("Mary had a little lamb.")print("Its fleece was white as {}".format('snow'))...原创 2019-01-09 19:33:45 · 190 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 6 Strings and Text
之前的练习一直在写字符串(strings),可能你还不知道它们有什么用。现在我们加强练习来弄明白它们是干什么的。首先解释一下:字符串是你想给某人看的信息,或者你想从程序里输出一些东西。只要放在单引号或双引号里通过 print 就能输出来。我们之前使用 f"blahblah{变量}" 把需要的变量放进去。python还有另一个格式: .format(), 我们接下来的练习中会用到。types...原创 2019-01-09 15:48:18 · 159 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 5 More Variables and Printing
输入更多的变量并把他们输出来。学习使用 f "{变量}"my_name = 'Zed A. Shaw'my_age = 35 # not a liemy_height = 74 # inchesmy_weight = 180 # lbsmy_eyes = 'Blue'my_teeth = 'White'my_hair = 'Brown'prin...原创 2019-01-09 14:49:02 · 201 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 9 Printing,Printing,Printing
知识点:巩固print里变量的输入和三引号的用法,\n的含义是换行笨方法继续从练习中学习,开始print!# Here's some new strange stuff, remember type it exactly.days = "Mon Tue Wed Thu Fri Sat Sun"months = "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug...原创 2019-01-14 22:01:32 · 176 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 8 Printing,Printing
继续print。下面的代码看起来复杂,不懂就注释,理解后,很简单。formatter = "{} {} {} {}"print(formatter.format(1, 2, 3, 4))print(formatter.format("one", "two", "three", &原创 2019-01-14 20:28:49 · 208 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 4 Variables and Names
我们已经能用 print 输出点东西和做点计算,下一步我们要学习变量。在python里,变量就是一个名字,一个标签。开始打代码cars = 100space_in_a_car = 4.0drivers = 30passengers = 90cars_not_driven = cars - driverscars_driven = driverscarpool_capacity ...原创 2019-01-08 10:53:10 · 175 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 3 Numbers and Math
说给初学者的话:programmers frequently lie about being math geniuses when they really aren’t. If they were math geniuses, they would be doing math, not writing buggy web frameworks so they can drive race cars...原创 2019-01-07 15:23:40 · 191 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 2 Comments and Pound Characters
注释的使用 # 符号后面的所有字符python都不会运行# A comment, this is so you can read your program later.# Anything after the # is ignored by python.print("I could have code like this.") # and the comment after i...原创 2018-12-29 12:11:32 · 223 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 11 Asking Qustions
知识点:print(end=’’)的用法,input的用法经过大量烦躁的练习后,我们现在get data into your programs。大部分的软件做的是以下的事情 :1、让用户输入点什么2、包装一下3、输出包装后的结果print("How old are you?", end=" ")age = input()print(&q原创 2019-01-21 22:38:04 · 169 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 17 More Files
建议ex15-17连起来练习原创 2019-01-31 15:51:15 · 239 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 35 Branches and Functions
原创 2019-02-14 19:50:20 · 147 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 34 Accessing Elements of Lists
原创 2019-02-14 17:33:22 · 185 阅读 · 0 评论 -
LearnPython3theHardWay__Excercise 22 What Do You Know So Far?
这一节没有什么代码给你练习。主要是让你回想一下迄今为止学到了什么。首先,回过头看看所有的练习里,我们用过的那些“有作用的字符串”,把它们记下来然后,写下它们的作用,干什么的。如果不懂,不记得了,就上网找,或者再做一次练习,用它写代码。现在的你,有些可能怎么都弄不明白。没关系。就记在清单上,当再遇到它们时看一下。有了清单后,过几天再重写,检查是否正确,虽然做法繁琐,但却非常有效。Th...原创 2019-02-02 22:29:16 · 182 阅读 · 0 评论