自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 收藏
  • 关注

原创 【Python for Everybody】quiz, assignment, exercise知识点

COUNT(*)表示ItcountstherowsinthetableUsers。只能由字母或下划线开头,并只能由字母、数字、下划线(underscore)组成。

2022-07-22 23:14:10 518

原创 【Python for Everybody】所有assignment课后作业代码

Findthelinkatposition18(thefirstnameis1).Followthatlink.Repeatthisprocess7times.Theansweristhelastnamethatyouretrieve.(重复7次,分别找出网页中位置第18的链接,并得到最后一次的链接上的人名)这题只需要按步骤复制粘贴就行了。按照提示操作就行,代码基本没改。...

2022-07-22 23:05:51 3376 1

原创 【Python for Everybody】16 Data Visualization

找出哪个网页拥有most best links

2022-07-18 12:33:34 317

原创 【Python for Everybody】15 Databases

数据库的建设很复杂,但复杂的构建正意味着理清了数据之间的关系逻辑,这大大提高了数据的处理速度httpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttps。.........

2022-07-18 09:50:59 166

原创 【Python for Everybody】14 Object-Oriented Programming

httpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttpshttps。

2022-07-17 15:03:29 413

原创 【Python for Everybody】13 Using Web Services

XMl更多用于文件。

2022-07-16 17:47:23 251

原创 【Python for Everybody】12 Network Programming

采用urllib可以将网页内容像file一样处理。调用socket包创建socket。有些网站不能爬,得看条款。用于获取网页中的链接。

2022-07-15 22:09:26 226

原创 【Python for Everybody】11 Regular Expressions

RegularExpressions,或叫做regex/regexp,是一种简洁灵活的匹配文本字符串的方法,是匹配与分析string的wildcard(万能牌)。如re.search(’^From',line),表示在line里寻找以From为句首的字符串。re.findall()提取string中匹配正则表达式中的部分,类似于find()和slicing[]的结合。“^X.*”表示以X开头,以结尾,中间随便是什么的文本,其中X和可以视为lockcharacter。......

2022-07-15 17:03:46 184

原创 【Python for Everybody】10 Turple

comparisonoperator适用于turple,从左至右依次进行比较,第一个元素如果能比出结果就不会再继续读取元素比较。对于temporaryvariable,一般我们使用turple而非list。用for循环将key-valuepair变成value-keypair。因为turple不可修改,它比list效率更高、占用内存更小。可以将turple理解成limitedlist。turple的一个赋值语句可以给两个变量赋值。count()某个元素在元组中出现的次数。...

2022-07-14 22:22:07 260

原创 【Python for Everybody】9 Dictionaries

dict.get(key,value)如果原字典里没有这个key,则将该key加入字典并附值value。用dict()或{}创建空字典。

2022-07-14 19:30:57 73

原创 【Python for Everybody】8 List

AlgorithmsA set of rules or steps used to solve a problemData StructureA particular way of organizing data in a computer和string类似,index都从0开始,可以用[]来索引Concatenating lists using +list.append() 在list 末尾增加一个元素list.insert(n,‘4’) 在指定位置添加元素,如果指定的下标不存在,那么就

2022-07-14 16:53:01 279

原创 【Python for Everybody】7 Files

text filea sequence of linesFile Processing:handle = open(filename, mode)filename is a stringmode is optional, it should be ‘r’ if wanna read the file and ‘w’ if wanna wirte to the filereturn a “file handle”hande 是指对file进行open、read、write、closewhen fi

2022-07-14 15:12:09 167

原创 【Python for Everybody】6 Strings

Index我们可以用square bracket[ ]里Index去提取string中的任意字符index value是从零开始的整数如果你试图index超过字符串长度的值,会报错Lenthlen()计算字符串的长度Looping Through Stringswhile用while statement、iteration variable和len function构建循环,去查看string里的每一个字母fruit = 'banana'index = 0while index

2021-12-28 22:58:09 328

原创 【Python for Everybody】5 Loops and Iterations

Repeated Stepsiteration variable我们构造出来用于控制该循环的变量,它告诉我们这个循环会循环几次While LoopWhile ...: #满足条件(即当...时候)开始循环 ....#停止循环infinite loop没有控制循环,导致其无限循环zero trip没有进入循环以至于跳过Loop Control StatementBreak#输出5n=0while True: #一直循环 if n>4: print(n) brea

2021-12-28 19:15:32 415

原创 【Python for Everybody】4 Functions

Stored (and Reused) Stepsdef ...: ...比如def thing(): #构造一个thing函数 print('hello') #定义thing函数为输出hellothing() #执行后的output为hello

2021-12-27 22:58:15 143

原创 【Python for Everybody】3 Conditional Execution

Comparison OperatorsOne-way decisionif …:print()print()Indentationtab等于4个spaces,但是space和tab不能混用Nested decisionsif …:if…:print()print()print()Two-Way Decisionsif …:print()else:print()print()Muti-Way Decisionsif …:print()elif …:print

2021-12-27 16:44:17 186

原创 【Python for Everybody】2 Variables, expressions and statements

Constants固定值,如数字、字母、字符串Reserved Words告诉python执行条件,不可用做variable names/identifierVariablesmemory里的一块可被命名的空间,可存储信息,稍后可通过它的“name”去retrieve命名规则:只能有字母或下划线开头,并只能有字母、数字、下划线(underscore)组成学会命mnemonic(助记的) variable name:Assignment Statement用=给变量赋值Numeric E

2021-12-27 15:14:06 201

原创 【Python for Everybody】1 Introduction

Hardware Overview作为programmer,我们是写一些程序在main memory里,作为指令告诉CPU what next,CPU帮我们执行。Reserved Wordswords that reserved for Python 去识别Statements or Lines一行代码叫做 a lineInteractive vs ScriptInteractive 输入了就立刻执行Script 通过text editor,写了一系列代码在文件里,然后再执行Progra

2021-12-27 13:31:02 349

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除