Python
暂时不用了的id
以后应该不会更新了,这些博文是我大二的时候写的,现在看来感觉很是幼稚。。
展开
-
【笔记】Part1:Python基础与代码风格 (Principles of Computing)
吐槽:由于作业实在太恶心,觉得其实也没有什么值得写的通常,所以我把以前的个别删了。既然是学知识,那不如做个笔记总结。。之所以写一篇是因为确实不多,主要我觉得值得看的也就代码风格吧。正文:1,Week1:Python基础与代码风格1)Basic elements of PythonBelow is a list of the data types in Python with whi...原创 2020-04-01 02:51:14 · 1024 阅读 · 0 评论 -
【笔记】Week1:生成器,栈与队列,继承,BFS (Principles of Computing)
吐槽:今天上到poc2的week1课程觉得还不错,但由于概念很陌生,觉得有必要记录一下。部分来源视频,部分来源其他博客。虽然视频是py2但不影响理解概念。正文:1,generators(生成器)什么是生成器:1)生成器是一个特殊的程序,可以被用作控制循环的迭代行为;2)生成器类似于返回值为数组的一个函数,这个函数可以接收参数,可以被调用,但是,不同于一般的函数会一次性返回包含了所有...原创 2020-04-01 02:13:52 · 224 阅读 · 2 评论 -
【题解】Musical Track Database (Using Databases with Python)
吐槽:额,忘了当时为啥没记录了,大概是偷懒解法就没写题解,然后今天发现有人在问,就顺便写一下我的方法吧。当时满分的时候是偷了个懒,今儿研究了一下顺便把不偷懒的方法也整出来了。有更好的也欢迎留言啦。题目:Musical Track DatabaseThis application will read an iTunes export file in XML and produce a pro...原创 2020-03-07 22:19:20 · 2606 阅读 · 2 评论 -
【题解】Quiz: Python for Everybody - A Review (Capstone: Retrieving, Processing, and Visualizing Data..)
吐槽:有些题想记录一下哈,很少有前面没做过的。题目&我想说的:1. Where in the computer is a variable such as "X" stored?x = 123A. Input DevicesB. Main MemoryC. Secondary MemoryD. Central processing unitE. Outpu...原创 2020-02-26 01:45:02 · 13070 阅读 · 0 评论 -
【题解】Databases and Visualization (peer-graded) (Using Databases with Python)
吐槽:这个作业花了我挺长时间,究其原因是没有好好看 README.txt 的内容,不过浪费的时间还是足以让我学到些。题目:Retrieving GEODataDownload the code from http://www.py4e.com/code3/geodata.zip - then unzip the file and edit where.data to add an addr...原创 2020-02-24 10:29:47 · 5399 阅读 · 16 评论 -
【题解】Quiz: Many-to-Many Relationships and Python (Using Databases with Python)
吐槽:有点难...= =听了课还是差点没满分...题目:1. In the following Python code sequence (assuming cur is a SQLite cursor object),cur.execute('SELECT count FROM Counts WHERE org = ? ', (org, ))row = cur.fetchone(...原创 2020-02-19 04:02:31 · 6158 阅读 · 2 评论 -
【题解】Counting Email in a Database (Using Databases with Python)
吐槽:一开始没仔细看题,然后就憨了= = 以及听课真的很重要。题目:Counting OrganizationsThis application will read the mailbox data (mbox.txt) and count the number of email messages per organization (i.e. domain name of the emai...原创 2020-02-18 01:39:16 · 2792 阅读 · 3 评论 -
【题解】Using the GeoJSON API (Using Python to Access Web Data)
吐槽:不难,修改一下老师的代码就出来了。最后一个题哦,这课我终于做完了= =题目:Calling a JSON APIIn this assignment you will write a Python program somewhat similar tohttp://www.py4e.com/code3/geojson.py. The program will prompt for ...原创 2020-02-11 02:14:00 · 5403 阅读 · 2 评论 -
【题解】Extracting Data from JSON (Using Python to Access Web Data)
吐槽:很简单就是记录一下。题目:Extracting Data from JSONIn this assignment you will write a Python program somewhat similar tohttp://www.py4e.com/code3/json2.py. The program will prompt for a URL, read the JSON...原创 2020-02-10 21:02:20 · 2532 阅读 · 0 评论 -
【题解】Extracting Data from XML (Using Python to Access Web Data)
吐槽:挺简单的,但还是想记一下,主要是decode和encode以前忘记记录了。题目:Extracting Data from XMLIn this assignment you will write a Python program somewhat similar tohttp://www.py4e.com/code3/geoxml.py. The program will prom...原创 2020-02-10 04:15:00 · 2430 阅读 · 0 评论 -
【题解】Quiz: eXtensible Markup Language (Using Python to Access Web Data)
吐槽:听课的时候没认真听时间这块,然后写这个的时候查了资料,想顺便记下来加深一下印象。答案都很简单就不写了。题目:1. What is a good time zone to use when computers are exchanging data over APIs?A. Universal Time / GMTB. The local time zone of the re...原创 2020-02-10 03:44:53 · 917 阅读 · 0 评论 -
【题解】Assignment: Following Links in HTML Using BeautifulSoup (Using Python to Access Web Data)
吐槽:好难哦...而且有个问题我一直不知道呢还,若有大佬看到这篇文章希望帮忙解决一下疑惑,感谢w题目:Following Links in PythonIn this assignment you will write a Python program that expands onhttp://www.py4e.com/code3/urllinks.py. The program wi...原创 2020-02-08 14:55:32 · 3719 阅读 · 6 评论 -
【题解】Scraping HTML Data with BeautifulSoup (Using Python to Access Web Data)
吐槽:因为不能听最新版的课,只好听完旧版的边查资料边写代码,太惨了8= =题目:Scraping Numbers from HTML using BeautifulSoupIn this assignment you will write a Python program similar tohttp://www.py4e.com/code3/urllink2.py. The prog...原创 2020-02-08 12:36:33 · 2241 阅读 · 4 评论 -
【题解】Understanding the Request / Response Cycle (Using Python to Access Web Data)
吐槽:开始觉得挺复杂,后来发现俩方法,值得记录。顺便,感谢大佬!题目:Exploring the HyperText Transport ProtocolYou are to retrieve the following document using the HTTP protocol in a way that you can examine the HTTP Response head...原创 2020-02-07 18:28:32 · 833 阅读 · 0 评论 -
【题解】Quiz: Networks and Sockets (Using Python to Access Web Data)
吐槽:这一章的quiz确实难一点,刷了三次才满分。因为是b站上好好听了一下课(https://www.bilibili.com/video/av46635818?p=16),所以答案都差不多知道只是不知道为啥是这样,究其原因还是对网络不太了解,等到这个课结束后我打算认真学习一下,然后再详细更新。(先挖个坑)简单的题我就不写啦0.0不会的话可以问我。题目:1.Which of the fo...原创 2020-02-07 17:09:11 · 1574 阅读 · 2 评论 -
【题解】Extracting Data With Regular Expressions (Using Python to Access Web Data)
吐槽:本来挺顺利的,主要就是想记录一下TypeError: 'int' object is not callable怎么解决,顺便记录我代码能改进的地方和哪个课后题的答案~ 嘿嘿,我觉得这种提示我们有更简单解法的题才有意思嘛0.0题目描述:大概就是从一个文件中提取所有数字并求和。Finding Numbers in a HaystackIn this assignment you wi...原创 2020-02-07 01:27:15 · 2165 阅读 · 1 评论 -
【题解】Chapter 10 Quiz (Python Data Structures)
吐槽:我只想记录俩题,其他的都很简单就不说了。主要其实是想弄个概念辨析的,不过最后还是改成了题解hhh题目:2. Which of the following methods work both in Python lists and Python tuples?A reverse()B pop()C append()D sort()E index()答案:E。元组...原创 2020-01-23 20:32:47 · 794 阅读 · 1 评论 -
【题解】Assignment 9.4 (Python Data Structures)
吐槽:还是没听课,然后被数据和系统坑了好久= =9.4Write a program to read through thembox-short.txtand figure out who has sent the greatest number of mail messages. The program looks for 'From ' lines and takes the sec...原创 2020-01-22 18:46:57 · 2306 阅读 · 0 评论 -
【题解】Assignment 8.4 (Python Data Structures)
吐槽:没听课就做题的话会发现很多不会,但是善用搜索总会解决的。顺便,我tm刚刚更新了个9.4怎么就把8.4删了??叫我重新敲一遍吗心态崩了= = 但是为了保持一下完整性,我还是重新敲了一遍(简直有病= = 以后肯定不会再憨了....8.4Open the fileromeo.txtand read it line by line. For each line, split the lin...原创 2020-01-23 02:21:16 · 3121 阅读 · 0 评论