摘要: 网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/disc/disc07/#oop problem1: problem2: problem3: problem4: problem 5: problem6: 阅读全文
posted @ 2022-04-07 13:35 天然气之子 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/proj/ants/#introduction #problem1: 修改两个ant类的food_cost,并且HarvesterAnt可以每回合加一个gamestate.food class Harvest 阅读全文
posted @ 2022-04-05 13:21 天然气之子 阅读(5379) 评论(0) 推荐(0) 编辑
摘要: 网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/lab/lab07/#topics problem1: case1: case2: case3: Account: class Account: """An account has a balance and 阅读全文
posted @ 2022-04-01 21:40 天然气之子 阅读(507) 评论(0) 推荐(0) 编辑
摘要: 网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/hw/hw05/#required-questions def gen_perms(seq): """Generates all permutations of the given sequence. Eac 阅读全文
posted @ 2022-04-01 13:52 天然气之子 阅读(510) 评论(0) 推荐(0) 编辑
摘要: 网址 https://inst.eecs.berkeley.edu/~cs61a/fa20/lab/lab06/#topics problem124: this_file = __file__ def make_adder_inc(a): """ >>> adder1 = make_adder_in 阅读全文
posted @ 2022-03-30 18:49 天然气之子 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/disc/disc06/#q1-wwpd-mutability problem1: problem2: problem3: problem4: problem5: problem6: problem7: 阅读全文
posted @ 2022-03-30 17:52 天然气之子 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/lab/lab06/#q5-repeated from re import I HW_SOURCE_FILE = __file__ def insert_items(lst, entry, elem): "" 阅读全文
posted @ 2022-03-28 13:13 天然气之子 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/hw/hw04/#required-questions problem10的不同原因是精度问题除法在计算机中精确的位数有限,只要数字足够大就会产生不同 代码: HW_SOURCE_FILE = __file_ 阅读全文
posted @ 2022-03-26 20:05 天然气之子 阅读(456) 评论(0) 推荐(0) 编辑
摘要: 网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/disc/disc05/ problem1: problem2: problem3: problem4: problem5: problem6: problem7: problem8: 只有‘1’这个奇数乘三 阅读全文
posted @ 2022-03-26 13:32 天然气之子 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/lab/lab05/#required-questions #problem1: def factors_list(n): """Return a list containing all the number 阅读全文
posted @ 2022-03-25 19:19 天然气之子 阅读(437) 评论(0) 推荐(0) 编辑