2021-2022-1 20211414《信息安全专业导论》第6周学习总结

作业信息

[2021-2022-1信息安全专业导论](https://edu.cnblogs.com/campus/besti/2021-2022-1fois)
[2021-2022-1信息安全专业导论第五周作业]https://www.cnblogs.com/rocedu/p/9577842.html#WEEK06

教材学习内容总结

Polya如何解决问题
简单类型与组合类型
复合数据结构
查找与排序算法
算法复杂度
递归
代码安全

教材学习中的问题和解决过程

问题:不理解教材中所说信息屏蔽技术具体是指什么
解决过程:到博客园查找相关资料了解信息屏蔽技术的原理及相关的实现方法,为相关的内容使用打下了基础。
问题:不明表在计算机算法中如何实现步骤的抽象
结局过程:查找相关视频了解抽象步骤的概念,明白其在计算机算法中的作用。

代码调试过程中的问题和解决过程

不明白为什么int函数输出时不是四舍五入
解决:在云班课上提问并得到同学的解答

代码托管

Type "help", "copyright", "credits" or "license()" for more information.
a='Hello'
a*2
'HelloHello'
a*=2
a
'HelloHello'
a='Hello'+','
a
'Hello,'
a+='World'
a
'Hello,World'
a='sparkle'
a[1:3]
'pa'
a[1:-1]
'parkl'
a[0:-1]
'sparkl'
a[0:-2]
'spark'
a[0:3]
'spa'
a[0:6]
'sparkl'
a[0:7]
'sparkle'
a[0:8]
'sparkle'
a[:]
'sparkle'
a='bcdefghijk'
a=[1:8:2]
SyntaxError: invalid syntax
a=[1:8]
SyntaxError: invalid syntax
a[1:8:2]
'cegi'
a[0:0:3]
''
a[::3]
'behk'
Python 3.10.0 (tags/v3.10.0:b494f59, Oct  4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
int("80")
80

int("80.0")
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    int("80.0")
ValueError: invalid literal for int() with base 10: '80.0'
float("80.0")
80.0
int("AB")
Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    int("AB")
ValueError: invalid literal for int() with base 10: 'AB'
int("AB,16")
Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    int("AB,16")
ValueError: invalid literal for int() with base 10: 'AB,16'
int("AB",16)
171
int("E",16)
14
str(123)
'123'
money=1535.1515546
str(money)
'1535.1515546'
str(True)
'True'
float(money)
1535.1515546
int(money)
1535
money=2.7
int(money)
2
i=32
s='i*i='+str(i*i)
s
'i*i=1024'
s='i*i={}'.format(i,i*i)
s
'i*i=32'
s='i*i={}'.format(i*i)
s
'i*i=1024'
s='{0}*{0}={1}'.format(i,i*i)
s
'32*32=1024'
s='{p1}*{p1}={p2}'.pormat(p1=i,p2=i*i)
Traceback (most recent call last):
  File "<pyshell#24>", line 1, in <module>
    s='{p1}*{p1}={p2}'.pormat(p1=i,p2=i*i)
AttributeError: 'str' object has no attribute 'pormat'. Did you mean: 'format'?
s
s='{p1}*{p1}={p2}'.format(p1=i,p2=i*i)
s
'32*32=1024'
monry=4679.1234568
money=5834.5678
name='Tony'
coding=utf-9
Traceback (most recent call last):
  File "<pyshell#31>", line 1, in <module>
    coding=utf-9
NameError: name 'utf' is not defined
'{0:s}年龄{1:d},工资是{2:f}元。'.format(name,20,money)
'Tony年龄20,工资是5834.567800元。'
{0}今天收入是{1:g}元。".format(name,money)
SyntaxError: invalid character '。' (U+3002)
"{0}今天收入是{1:g}元。".format(name,money)
'Tony今天收入是5834.57元。'
'十进制数{0:d}的八进制表示为{0:o}'.format(18)
'十进制数18的八进制表示为22'
s_str='hello world'
s_str.find('e')
1
s_str.find('1')
-1
s_str.find('1',4,6)
-1

text='AB CD EF GH IJ'
text.replace(' ','|',2)
'AB|CD|EF GH IJ'
text.replace(' ','|',1)
'AB|CD EF GH IJ'
text.split(' ')
['AB', 'CD', 'EF', 'GH', 'IJ']
text.split(' ',maxsplit=0)
['AB CD EF GH IJ']
text.split(' ' ,maxsplit=2)
['AB', 'CD', 'EF GH IJ']
#coding=utf-8

#一篇文章文本
wordstring = """
    it was the best times it was the worst times.
    it was the age of wisdom it was the age of foolishness.
    """
#将标点符号替换
wordstring = wordstring.replace('.','')

#分割单词
wordlist = wordstring.split()

wordfreq = []
for w in wordlist:
    #统计单词出现个数
    wordfreq.append(wordlist.count(w))

d=dict(zip(wordlist,wordfreq))
print(d)

上周考试错题总结:

The following equation is an example of which Boolean algebra property?
A. CommutativeB. AssociativeC. DistributiveD. IdentityE. ComplementF. De Morgan's law应为B

学习进度条

代码行数(新增/累积) 博客量(新增/累积) 学习时间(新增/累积) 重要成长
目标 5000行 30篇 400小时
第一周 200/200 2/2 20/20
第二周 300/500 2/4 18/38
第三周 500/1000 3/7 22/60
第四周 300/1300 2/9 30/90
第五周 700/1600 5/7 78/110
第六周 900/1900 7/9 90/130

参考资料

《计算机科学概论》
《看漫画学python》视频课

posted @ 2021-10-30 17:14  20211414董准  阅读(43)  评论(0编辑  收藏  举报