cs50第七课课后作业
学习笔记
第八课题
-
找文档相似的部分
-
结果
-
核心代码:
def substrings(a, b, n): """Return substrings of length n in both a and b""" common_list = [] for i in range(len(a)): if(i+n > len(a)): break else: endindex = i+n substring = a[i:endindex] if(b.count(substring) > 0 and common_list.count(substring) == 0): common_list.append(substring) return common_list
-
-
调查
-
结果
-
核心代码
{% for student in students %} <tr> <td>{{ student[0] }}</td> <td>{{ student[1] }}</td> <td>{{ student[2] }}</td> </tr> {% endfor %}
file = open("survey.csv", "a") writer = csv.writer(file, delimiter=",") writer.writerow([name, house, position]) file.close()
-