2021-2022-1 1202111301 《信息安全专业导论》第七周学习总结
2021-2022-1 1202111301 《信息安全专业导论》第七周学习总结
作业信息
|这个作业属于哪个课程|https://edu.cnblogs.com/campus/besti/2021-2022-1fois
|这个作业要求在哪里|https://www.cnblogs.com/rocedu/p/9577842.html#WEEK07
|这个作业的目标|<
数组与链表
基于数组和基于链表实现数据结构
无序表与有序表
树
图
子程序与参数>|
|作业正文| https://i.cnblogs.com/posts/edit
教材学习内容总结
《计算机科学概论》
1.列表和数组
-数组是内嵌结构
-列表是抽象结构(线性结构)
2.树:分层体系结构
-二叉树:具有唯一起始节点
-根:唯一的开始节点
-叶节点:没有子女的树节点
-二叉检索树:递归算法
3.图
-区别于数:一个节点可以有多个父母点,节点叫顶点
-边(弧):两个节点连接的顶点对
-有向图,无向图
-创建图:顶点,边,权值
-图算法:深度优先搜索,广度优先搜索,单源最短路搜索
4.子程序
-参数列表:形参(临时)(列在子程序后的括号中的标识符)实参(子程序调用中列在括号中的标识符)
《看漫画学python》
# coding=utf-8
def rect_area(width,height):
area = width * height
return area
r_area = rect_area(320,480)
print("{0} * {1} 长方形的面积:{2:.2f}".format(320,480,r_area))
320 * 480 长方形的面积:153600.00
# coding=utf-8
def rect_area(width,height):
area = width * height
return area
r_area = rect_area(width=320,height=480)
print("{0} * {1} 长方形的面积:{2:.2f}".format(320,480,r_area))
r_area = rect_area(height=480,width=320)
print("{0} * {1} 长方形的面积:{2:.2f}".format(320,480,r_area))
320 * 480 长方形的面积:153600.00
320 * 480 长方形的面积:153600.00
# coding=utf-8
def make_coffee(name='卡布奇诺'):
return "制作一杯{0}咖啡".format(name)
coffee1 = make_coffee("拿铁")
coffee2 = make_coffee()
print(coffee1)
print(coffee2)
制作一杯拿铁咖啡
制作一杯卡布奇诺咖啡
def sum(*numbers):
total = 0.0
for number in numbers:
total += number
return total
print(sum(100.0,20.0,30.0))
print(sum(30.0,80.0))
150.0
110.0
def show_info(**info):
print('----show_info-----')
for key, value in info.items():
print('{0} - {1}'.format(key,value))
show_info(name='Tony',age=18,sex=True)
show_info(student_name='Tony',student_no=1000)
----show_info-----
name - Tony
age - 18
sex - True
----show_info-----
student_name - Tony
student_no - 1000
x = 20
def print_value():
x = 10
print("函数中x = {0}".format(x))
print_value()
print("全局变量x = {0}".format(x))
函数中x = 10
全局变量x = 20
x = 20
def print_value():
global x
x = 10
print("函数中x = {0}".format(x))
print_value()
print("全局变量x = {0}".format(x))
函数中x = 10
全局变量x = 10
def add(a,b):
return a + b
def sub(a,b):
return a - b
def calc(opr):
if opr == '+':
return add
else:
return sub
f1 = calc('+')
f2 = calc('-')
print("10 + 5 ={0}".format(f1(10,5)))
print("10 - 5 ={0}".format(f2(10,5)))
10 + 5 =15
10 - 5 =5
def f1(x):
return x > 50
data1 = [66,70,89,4,3,2,1,40,90,100]
filterd = filter(f1,data1)
data2 = list(filterd)
print(data2)
[66, 70, 89, 90, 100]
def f1(x):
return x * 2
data1 = [66,76,80,44,33,2,3]
mapped = map(f1,data1)
data2 = list(mapped)
print(data2)
[132, 152, 160, 88, 66, 4, 6]
def calc(opr):
if opr == '+':
return lambda a,b:(a + b)
else:
return lambda a,b:(a - b)
f1 = calc('+')
f2 = calc('-')
print("10 + 5 ={0}".format(f1(10,5)))
print("10 - 5 ={0}".format(f2(10,5)))
10 + 5 =15
10 - 5 =5
data1 = [66,70,89,4,3,2,1,40,90,100]
filterd = filter(lambda x:(x > 50),data1)
data2 = list(filterd)
print(data2)
[66, 70, 89, 90, 100]
data1 = [66,76,80,44,33,2,3]
mapped = map(lambda x:(x*2),data1)
data2 = list(mapped)
print(data2)
[132, 152, 160, 88, 66, 4, 6]
教材学习中的问题和解决过程
(一个模板:我看了这一段文字 (引用文字),有这个问题 (提出问题)。 我查了资料,有这些说法(引用说法),根据我的实践,我得到这些经验(描述自己的经验)。 但是我还是不太懂,我的困惑是(说明困惑)。【或者】我反对作者的观点(提出作者的观点,自己的观点,以及理由)。 )
- 问题1:
- 问题1解决方案:
- 问题2:
- 问题2解决方案:
代码调试中的问题和解决过程
- 问题1:用idle无法运行
- 问题1解决方案:要用run module,而且要保存
学习进度条
代码行数(新增/累积) | 博客量(新增/累积) | 学习时间(新增/累积) | 重要成长 | |
---|---|---|---|---|
目标 | 5000行 | 30篇 | 400小时 | |
第一周 | 200/200 | 2/2 | 20/20 | |
第二周 | 300/500 | 2/4 | 18/38 | |
第三周 | 300/800 | 3/7 | 22/60 | |
第四周 | 300/1100 | 2/9 | 30/90 | |
第五周 | 200/1300 | 2/11 | 10/100 | |
第六周 | 300/1100 | 4/15 | 30/130 | |
第七周 | 200/1300 | 3/17 | 20/150 | |