python语言思想

news/2024/5/4 15:28:34/文章来源:https://blog.csdn.net/m0_46525584/article/details/120781122

python语言基础与应用
超级计算器
在这里插入图片描述
python语言解释器
为啥选用PYCHARM
在这里插入图片描述
create new project:
NANE+ 选择解释器
open ,选择打开文件或者加入project
在这里插入图片描述
注意对齐与缩进
注意字母大小写、空格
注意左右括号配对

错误是常见的,跟BUG和缺陷斗争得到过程
观察代码文本要求:注意上述的注意事项

对数据的抽象,对问题的处理采用的是对数据的抽象,避免处理其他杂糅的数据
何为大数据:
在这里插入图片描述
大数据分析处理语言
多种多样的数据类型
简单类型用来表示值
容器类型用来组织这些值
在这里插入图片描述
在这里插入图片描述
何为计算:
对现实世界处理和过程的抽象
控制流语句
定义语句:把一系列语句集合起来起一个名字 描述了一个包含一系列处理过程的计算单元 标签
基本类型:数值
整数类型:
双大小比较号 为比较判断 得到逻辑值 真或假
是很遵循数学逻辑
数的进制 所谓进制 9>0变两位加1 为10
整数的各种进制表示
0b 0o 0x
浮点数收到17位有限数字的限制
科学计数法:2.3*10^5
有效数字为2位
在这里插入图片描述
除了内置数学
还有math模块 面向整数浮点数
cmath 面向复数
基本类型:逻辑值
逻辑运算:双目运算 :与 and 或or ,
单目运算:非not:
优先级not最高 and ,or最低
关于优先级往往会用括号进行提示,并非读代码人员运用所掌握的优先级方法转换
在这里插入图片描述
not None 变为真
字符数据类型:
三个连续单引号表示多行字符串 也就是包含了换行的位
转移符号:
在这里插入图片描述
字符串有哪些操作?:
小于0 的反方向编号
在这里插入图片描述
字符串是数据的本身
名字是数据的标签
名字和字符串是“名”与“值”之间的关系
常见的字符串操作:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
序列:
字符串是一种序列
在这里插入图片描述
给数据的命名:

名字与变量
名字像一个标签
名字和数值之间的关联称为引用
在这里插入图片描述
设么是变量、何为变量?
与数值关联的名字也称作变量,
在这里插入图片描述
在这里插入图片描述
python语言是动态的语言
可以随时指向任何的类型,其他常见语言都是静态的
何为赋值? 名字与数值关联的过程,称为给变量赋值,数值也称为数据对象
在这里插入图片描述
python 是语言大师创造的语言
在这里插入图片描述
上机练习时间:
在这里插入图片描述
要更注意错误,需要学会看错误,
在这里插入图片描述

Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> 4.2+2.1==6.3
False
>>> print4.2+2.1)File "<stdin>", line 1print4.2+2.1^
SyntaxError: invalid character in identifier
>>> print(4+1)
5
>>> 4.2+2.1
6.300000000000001
>>> 1+3j
(1+3j)
>>> (1+2j).real
1.0
>>> (1+2j).imag
2.0
>>> import math
>>> dir(math)
['__doc__', '__loader__', '__name__', '__package__', '__spec__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'comb', 'copysign', 'cos', 'cosh', 'degrees', 'dist', 'e', 'erf', 'erfc', 'exp', 'expm1', 'fabs', 'factorial', 'floor', 'fmod', 'frexp', 'fsum', 'gamma', 'gcd', 'hypot', 'inf', 'isclose', 'isfinite', 'isinf', 'isnan', 'isqrt', 'ldexp', 'lgamma', 'log', 'log10', 'log1p', 'log2', 'modf', 'nan', 'perm', 'pi', 'pow', 'prod', 'radians', 'remainder', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'tau', 'trunc']
>>> h=88
>>> m=g="dd"
>>> m
'dd'
>>> g
'dd'
>>> h
88
>>> type(h)
<class 'int'>
>>> type (m)
<class 'str'>
>>> len(m)
2
>>> n="qwertyuiop"
>>> n[1:6]
'werty'
>>> n*2
'qwertyuiopqwertyuiop'
>>> c=n*2
>>> c
'qwertyuiopqwertyuiop'
>>> c.isalpha
<built-in method isalpha of str object at 0x000001A0A09619E0>
>>> h.isdigit
Traceback (most recent call last):File "<stdin>", line 1, in <module>
AttributeError: 'int' object has no attribute 'isdigit'
>>> n=" ppq"
>>> c=n*3
>>> c
' ppq ppq ppq'
>>> c.split('')
Traceback (most recent call last):File "<stdin>", line 1, in <module>
ValueError: empty separator
>>> c.split(' ')
['', 'ppq', 'ppq', 'ppq']
>>> me="how are you, i an fine thankyou"
>>> me.split(" ")
['how', 'are', 'you,', 'i', 'an', 'fine', 'thankyou']
>>>  me[1]File "<stdin>", line 1me[1]^
IndentationError: unexpected indent
>>> me[1:]
'ow are you, i an fine thankyou'
>>> me[1;2]File "<stdin>", line 1me[1;2]^
SyntaxError: invalid syntax
>>> me[1:2]
'o'
>>> me[-1:-3]
''
>>> me[1:10]
'ow are yo'
>>> me[-3-1]File "<stdin>", line 1me[-3-1]^
SyntaxError: invalid character in identifier
>>> me[-1:-3:1]
''
>>> me[-1:-10]
''
>>> me.upper
<built-in method upper of str object at 0x000001A0A0961940>
>>> me.upper()
'HOW ARE YOU, I AN FINE THANKYOU'
>>> "+++".join(me)
'h+++o+++w+++ +++a+++r+++e+++ +++y+++o+++u+++,+++ +++i+++ +++a+++n+++ +++f+++i+++n+++e+++ +++t+++h+++a+++n+++k+++y+++o+++u'
>>> "+".join(me,c,"nihaoma")
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: join() takes exactly one argument (3 given)
>>> "+".join(me,c)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: join() takes exactly one argument (2 given)
>>> "+".join([me,c])
'how are you, i an fine thankyou+ ppq ppq ppq'
>>> "".join(["123456789"])
'123456789'
>>> "+".join("123456789")
'1+2+3+4+5+6+7+8+9'
>>> "+".join(["111"])
'111'
>>> me[0]
'h'
>>> me[-1]
'u'
>>> me[1]
'o'
>>> me[2]
'w'
>>> me.in("h"0File "<stdin>", line 1me.in("h"0^
SyntaxError: invalid syntax
>>> me.in("h")File "<stdin>", line 1me.in("h")^
SyntaxError: invalid syntax
>>> me.in"h"File "<stdin>", line 1me.in"h"^
SyntaxError: invalid syntax
>>> me.in(h)File "<stdin>", line 1me.in(h)^
SyntaxError: invalid syntax
>>> hex(33)
'0x21'
>>> oct(7)
'0o7'
>>> bin(7)
'0b111'
>>> 1.str()File "<stdin>", line 11.str()^
SyntaxError: invalid syntax
>>> str(1)
'1'
>>> int("abc")
Traceback (most recent call last):File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: 'abc'
>>> int(abc)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'abc' is not defined
>>> int(1)
1
>>> float(1)
1.0
>>> double(1)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'double' is not defined
>>> str(False)
'False'
>>> bool(1)
True
>>> bool(False)
False
>>> bool(false)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'false' is not defined
>>> int(sbc)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'sbc' is not defined
>>> 1 is None
<stdin>:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
False
>>> 1 is None
<stdin>:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
False
>>> me+c
'how are you, i an fine thankyou ppq ppq ppq'
>>> d=me+c
>>>
>>> d
'how are you, i an fine thankyou ppq ppq ppq'
>>> ord("A")
65
>>> chr("A")
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: an integer is required (got type str)
>>> chr(65)
'A'
>>> chr(64)
'@'
>>> d.inFile "<stdin>", line 1d.in^
SyntaxError: invalid syntax
>>> d
'how are you, i an fine thankyou ppq ppq ppq'
>>> "h" in d
True
>>> p in d
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'p' is not defined
>>> "w a" in d
True
>>> "wa"in d
False
>>> ord("猪")
29482
>>> chr(29482)
'猪'
>>> ord(d)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: ord() expected a character, but string of length 43 found
>>> ord("你好")
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: ord() expected a character, but string of length 2 found
>>> len("你好“)File "<stdin>", line 1len("你好“)^
SyntaxError: EOL while scanning string literal
>>> len("nihao")
5
>>> len("你好")
2
>>> d[1]
'o'
>>> s[-1]
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 's' is not defined
>>> d[-1]
'q'
>>> d[-1:-5]
''
>>> print(d[-1;-5])File "<stdin>", line 1print(d[-1;-5])^
SyntaxError: invalid syntax
>>> d[-1:-5:]
''
>>> d[-1:]
'q'
>>> d[-2]
'p'
>>> d[::-1]
'qpp qpp qpp uoyknaht enif na i ,uoy era woh'
>>> d[-1:-5:-1]
'qpp '
>>> d.split(" ")
['how', 'are', 'you,', 'i', 'an', 'fine', 'thankyou', 'ppq', 'ppq', 'ppq']
>>> d.center
<built-in method center of str object at 0x000001A0A08D4BD0>
>>> d.center()
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: center expected at least 1 argument, got 0
>>> center(d)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'center' is not defined
>>> d.center(30)
'how are you, i an fine thankyou ppq ppq ppq'
>>> "ppp".center(10)
'   ppp    '
>>> "ppp".center(100)
'                                                ppp                                                 '
>>> d.replace("how","mememe")
'mememe are you, i an fine thankyou ppq ppq ppq'
>>>
>>>> d.isdigit(
...
...
... )
False
>>> d.isdigit()
False
>>> d.isalpha()
False
>>> d.isalpha(h)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: isalpha() takes no arguments (1 given)
>>> f.isalpha("h")
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'f' is not defined
>>> "123 ".isdigit()
False

数据收纳盒:
面临得需要处理的问题:如何使用? 名字[n]
列表,
元组(不可变序列)
在这里插入图片描述
在这里插入图片描述
字符串用“”
列表用[]
元组用()
列表的操作
容器,何为容器?是从简单数据类型引申出来的容器将简单类型数据组织起来
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

函数reversed不返回列表,而是返回一个迭代器。可使用list将返回的对象转换为列表。
在这里插入图片描述

>>> box["1",1,"a"]
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'box' is not defined
>>> box[1]
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'box' is not defined
>>> box=["ss","1",1]
>>> box
['ss', '1', 1]
>>> len.box
Traceback (most recent call last):File "<stdin>", line 1, in <module>
AttributeError: 'builtin_function_or_method' object has no attribute 'box'
>>> box.len
Traceback (most recent call last):File "<stdin>", line 1, in <module>
AttributeError: 'list' object has no attribute 'len'
>>> me.len
Traceback (most recent call last):File "<stdin>", line 1, in <module>
AttributeError: 'str' object has no attribute 'len'
>>> len(box)
3
>>> type(box)
<class 'list'>
>>> a1= list(me)
>>> a1
['h', 'o', 'w', ' ', 'a', 'r', 'e', ' ', 'y', 'o', 'u', ',', ' ', 'i', ' ', 'a', 'n', ' ', 'f', 'i', 'n', 'e', ' ', 't', 'h', 'a', 'n', 'k', 'y', 'o', 'u']
>>> print(a1)
['h', 'o', 'w', ' ', 'a', 'r', 'e', ' ', 'y', 'o', 'u', ',', ' ', 'i', ' ', 'a', 'n', ' ', 'f', 'i', 'n', 'e', ' ', 't', 'h', 'a', 'n', 'k', 'y', 'o', 'u']
>>> len(a1)
31
>>> a=["s",3,a1]
>>> a
['s', 3, ['h', 'o', 'w', ' ', 'a', 'r', 'e', ' ', 'y', 'o', 'u', ',', ' ', 'i', ' ', 'a', 'n', ' ', 'f', 'i', 'n', 'e', ' ', 't', 'h', 'a', 'n', 'k', 'y', 'o', 'u']]
>>> a.pop()
['h', 'o', 'w', ' ', 'a', 'r', 'e', ' ', 'y', 'o', 'u', ',', ' ', 'i', ' ', 'a', 'n', ' ', 'f', 'i', 'n', 'e', ' ', 't', 'h', 'a', 'n', 'k', 'y', 'o', 'u']
>>> a.pop
<built-in method pop of list object at 0x000001A0A08C6D40>
>>> a.pop(0)
's'
>>> a
[3]
>>> a.append(a)
>>> a
[3, [...]]
>>> a
[3, [...]]
>>> a.append("aa")
>>> a
[3, [...], 'aa']
>>> a.extend(a)
>>>
>>> a
[3, [...], 'aa', 3, [...], 'aa']
>>> a.insert(2,"ppp")
>>> a
[3, [...], 'ppp', 'aa', 3, [...], 'aa']
>>> a.insert(2,a)
>>> a
[3, [...], [...], 'ppp', 'aa', 3, [...], 'aa']
>>> a.reverse
<built-in method reverse of list object at 0x000001A0A08C6D40>
>>>  a.reverse()File "<stdin>", line 1a.reverse()^
IndentationError: unexpected indent
>>> a.reverse()
>>> a
['aa', [...], 3, 'aa', 'ppp', [...], [...], 3]
>>> a.sort()
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: '<' not supported between instances of 'list' and 'str'
>>> a=[1,2,3]
>>> a.sort()
>>> a
[1, 2, 3]
>>> a.sort(reverse = true)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'true' is not defined
>>> a.sort(reverse = True)
>>> a
[3, 2, 1]
>>> me
'how are you, i an fine thankyou'
>>> b1=list(me)
>>> b1
['h', 'o', 'w', ' ', 'a', 'r', 'e', ' ', 'y', 'o', 'u', ',', ' ', 'i', ' ', 'a', 'n', ' ', 'f', 'i', 'n', 'e', ' ', 't', 'h', 'a', 'n', 'k', 'y', 'o', 'u']
>>> reversed(a)
<list_reverseiterator object at 0x000001A0A046F820>
>>> a
[3, 2, 1]
>>> c1=reversed(a)
>>> c1
<list_reverseiterator object at 0x000001A0A046F820>
>>> a
[3, 2, 1]
>>> a
[3, 2, 1]
>>> c1
<list_reverseiterator object at 0x000001A0A046F820>
>>> c2=list(reversed(c1))
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: 'list_reverseiterator' object is not reversible
>>> c2
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'c2' is not defined
>>> c2=list(reversed(a))
>>> c2
[1, 2, 3]
>>> c3=list(c2)
>>> c3
[1, 2, 3]
>>> c3=list(c1)
>>> c3
[1, 2, 3]
>>> c4=list(sorted(c3))
>>> c4
[1, 2, 3]
>>> c5=list(c4.reverse())
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: 'NoneType' object is not iterable
>>> c4.reverse()
>>> c4
[1, 2, 3]

在这里插入图片描述
报错:
SyntaxError: invalid syntax 语法错误,详解。

在这里插入图片描述
在这里插入图片描述
TypeError: extend() takes exactly one argument (2 given)
TypeError:ExpDug()正好有一个参数(2给出)
在这里插入图片描述
AttributeError: ‘str’ object has no attribute ‘sort’
AttributeError:“str”对象没有属性“sort”

在这里插入图片描述
在这里插入图片描述

>>> 10**16
10000000000000000
>>> 22/7
3.142857142857143
>>> a=[1,2,3,"sss"]
>>> a
[1, 2, 3, 'sss']
>>> len(a)
4
>>> b=list(reversed(a))
>>> b
['sss', 3, 2, 1]
>>> b.pop()
1
>>> b
['sss', 3, 2]
>>> b.pop(0)
'sss'
>>> b
[3, 2]
>>> b.append("qwer")
>>> b
[3, 2, 'qwer']
>>> b.append(a)
>>> b
[3, 2, 'qwer', [1, 2, 3, 'sss']]
>>> b.append(a,c[1])
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'c' is not defined
>>> b.append(b)
>>> b
[3, 2, 'qwer', [1, 2, 3, 'sss'], [...]]
>>> len(b(
... len(b)
... bFile "<stdin>", line 3b^
SyntaxError: invalid syntax
>>> b
[3, 2, 'qwer', [1, 2, 3, 'sss'], [...]]
>>> len(b)
5
>>> a.extend()
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: extend() takes exactly one argument (0 given)
>>> s
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 's' is not defined
>>> a
[1, 2, 3, 'sss']
>>> a.extend(b)
>>> a
[1, 2, 3, 'sss', 3, 2, 'qwer', [...], [3, 2, 'qwer', [...], [...]]]
>>> a=("a",1,""," ")
>>> a
('a', 1, '', ' ')
>>> len(a)
4
>>> a.pop(0)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
AttributeError: 'tuple' object has no attribute 'pop'
>>> a.pop(1)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
AttributeError: 'tuple' object has no attribute 'pop'
>>> a
('a', 1, '', ' ')
>>> b
[3, 2, 'qwer', [1, 2, 3, 'sss', 3, 2, 'qwer', [...], [...]], [...]]
>>> b.pop(1)
2
>>> b
[3, 'qwer', [1, 2, 3, 'sss', 3, 2, 'qwer', [...], [...]], [...]]
>>> b.reverse()
>>> b
[[...], [1, 2, 3, 'sss', 3, 2, 'qwer', [...], [...]], 'qwer', 3]
>>> b.remove([])
Traceback (most recent call last):File "<stdin>", line 1, in <module>
ValueError: list.remove(x): x not in list
>>> b.remove(3)
>>> b
[[...], [1, 2, 3, 'sss', 3, 2, 'qwer', [...], [...]], 'qwer']
>>> b.remove("qwer")
>>> b
[[...], [1, 2, 3, 'sss', 3, 2, 'qwer', [...], [...]]]
>>> b
[[...], [1, 2, 3, 'sss', 3, 2, 'qwer', [...], [...]]]
>>> b.append("3")
>>> b
[[...], [1, 2, 3, 'sss', 3, 2, 'qwer', [...], [...]], '3']
>>> b.append(3)
>>> b
[[...], [1, 2, 3, 'sss', 3, 2, 'qwer', [...], [...]], '3', 3]
>>> b.remove("3")
>>> b
[[...], [1, 2, 3, 'sss', 3, 2, 'qwer', [...], [...]], 3]
>>> b.remove("3")
Traceback (most recent call last):File "<stdin>", line 1, in <module>
ValueError: list.remove(x): x not in list
>>> b.del()File "<stdin>", line 1b.del()^
SyntaxError: invalid syntax
>>> b.del(1)File "<stdin>", line 1b.del(1)^
SyntaxError: invalid syntax
>>> b.count(3)
1
>>> b.cout([])
Traceback (most recent call last):File "<stdin>", line 1, in <module>
AttributeError: 'list' object has no attribute 'cout'
>>> b.index(3)
2
>>> len(b)
3
>>> b.append(3,4,5)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: append() takes exactly one argument (3 given)
>>> b.append(3)
>>> b
[[...], [1, 2, 3, 'sss', 3, 2, 'qwer', [...], [...]], 3, 3]
>>> b.extend(1,2,3)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: extend() takes exactly one argument (3 given)
>>> b.append(b)
>>> b
[[...], [1, 2, 3, 'sss', 3, 2, 'qwer', [...], [...]], 3, 3, [...]]
>>> b.index(3)
2
>>> b.del(2)File "<stdin>", line 1b.del(2)^
SyntaxError: invalid syntax
>>> b.dle(2)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
AttributeError: 'list' object has no attribute 'dle'
>>> del.b[1]File "<stdin>", line 1del.b[1]^
SyntaxError: invalid syntax
>>> b
[[...], [1, 2, 3, 'sss', 3, 2, 'qwer', [...], [...]], 3, 3, [...]]
>>> del.b[2]File "<stdin>", line 1del.b[2]^
SyntaxError: invalid syntax
>>> del b[2]
>>> b
[[...], [1, 2, 3, 'sss', 3, 2, 'qwer', [...], [...]], 3, [...]]
>>> del b[1]
>>> b
[[...], 3, [...]]
>>> b
[[...], 3, [...]]
>>> del b[]File "<stdin>", line 1del b[]^
SyntaxError: invalid syntax
>>> del b[0]
>>> b
[3, [...]]
>>> b.append("1")
>>> b
[3, [...], '1']
>>> b.append(1)
>>> b
[3, [...], '1', 1]
>>> print (b)
[3, [...], '1', 1]
>>> b
[3, [...], '1', 1]
>>> b.remove(2)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
ValueError: list.remove(x): x not in list
>>> b.remove(1)
>>> b
[3, [...], '1']
>>> b.index("1")
2
>>> b.sort()
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: '<' not supported between instances of 'list' and 'int'
>>> b.extend(b)
>>> b
[3, [...], '1', 3, [...], '1']
>>> b.extend("a")
>>> b
[3, [...], '1', 3, [...], '1', 'a']
>>> b.extend(z)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'z' is not defined
>>> b.extend(1)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: 'int' object is not iterable
>>> b.extend(b,b)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: extend() takes exactly one argument (2 given)
>>> b.extend(b)
>>> b
[3, [...], '1', 3, [...], '1', 'a', 3, [...], '1', 3, [...], '1', 'a']
>>> len(b)
14
>>> b.del(0S)File "<stdin>", line 1b.del(0S)^
SyntaxError: invalid syntax
>>> b.del(0)File "<stdin>", line 1b.del(0)^
SyntaxError: invalid syntax
>>> b.del(0)File "<stdin>", line 1b.del(0)^
SyntaxError: invalid syntax
>>> b.dle(0)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
AttributeError: 'list' object has no attribute 'dle'
>>> del b[1]
>>> b
[3, '1', 3, [...], '1', 'a', 3, [...], '1', 3, [...], '1', 'a']
>>> a=[1,"d"]
>>> c=s+b
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 's' is not defined
>>> c=a+b
>>> c
[1, 'd', 3, '1', 3, [3, '1', 3, [...], '1', 'a', 3, [...], '1', 3, [...], '1', 'a'], '1', 'a', 3, [3, '1', 3, [...], '1', 'a', 3, [...], '1', 3, [...], '1', 'a'], '1', 3, [3, '1', 3, [...], '1', 'a', 3, [...], '1', 3, [...], '1', 'a'], '1', 'a']
>>> a+b
[1, 'd', 3, '1', 3, [3, '1', 3, [...], '1', 'a', 3, [...], '1', 3, [...], '1', 'a'], '1', 'a', 3, [3, '1', 3, [...], '1', 'a', 3, [...], '1', 3, [...], '1', 'a'], '1', 3, [3, '1', 3, [...], '1', 'a', 3, [...], '1', 3, [...], '1', 'a'], '1', 'a']
>>> a+b
[1, 'd', 3, '1', 3, [3, '1', 3, [...], '1', 'a', 3, [...], '1', 3, [...], '1', 'a'], '1', 'a', 3, [3, '1', 3, [...], '1', 'a', 3, [...], '1', 3, [...], '1', 'a'], '1', 3, [3, '1', 3, [...], '1', 'a', 3, [...], '1', 3, [...], '1', 'a'], '1', 'a']
>>> c=(1,2,"s")
>>> c+c
(1, 2, 's', 1, 2, 's')
>>> c*2
(1, 2, 's', 1, 2, 's')
>>> c*3
(1, 2, 's', 1, 2, 's', 1, 2, 's')
>>> print(c*3)
(1, 2, 's', 1, 2, 's', 1, 2, 's')
>>> a="s,1"
>>> a
's,1'
>>> a="a,1,"1","a""File "<stdin>", line 1a="a,1,"1","a""^
SyntaxError: invalid syntax
>>> a="a"
>>>
>>> a
'a'
>>> a="a,"1""File "<stdin>", line 1a="a,"1""^
SyntaxError: invalid syntax
>>> a="1"
>>> a
'1'
>>> type(a)
<class 'str'>
>>> a="1,\"File "<stdin>", line 1a="1,\"^
SyntaxError: EOL while scanning string literal
>>> a="1,2,3"
>>> a.sort()
Traceback (most recent call last):File "<stdin>", line 1, in <module>
AttributeError: 'str' object has no attribute 'sort'
>>> b
[3, '1', 3, [...], '1', 'a', 3, [...], '1', 3, [...], '1', 'a']
>>> b.sort()
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: '<' not supported between instances of 'str' and 'int'
>>> a
'1,2,3'
>>> a[2]
'2'
>>> a[1,2]
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: string indices must be integers
>>> a
'1,2,3'
>>> a[1]
','
>>> a
'1,2,3'
>>> a[2]
'2'
>>> a
'1,2,3'
>>> a[1]
','
>>> a[0]
'1'
>>> a[3]
','
>>> a[4]
'3'
>>> a
'1,2,3'
>>> a
'1,2,3'
>>> a"0"File "<stdin>", line 1a"0"^
SyntaxError: invalid syntax
>>> a
'1,2,3'
>>> type(a)
<class 'str'>
>>> a
'1,2,3'
>>> a=list(a)
>>> a
['1', ',', '2', ',', '3']
>>> a[1]
','
>>> a=str(a)
>>> a
"['1', ',', '2', ',', '3']"
>>> a
"['1', ',', '2', ',', '3']"
>>> type(a)
<class 'str'>
>>> a
"['1', ',', '2', ',', '3']"
>>> a=list(a)
>>> a
['[', "'", '1', "'", ',', ' ', "'", ',', "'", ',', ' ', "'", '2', "'", ',', ' ', "'", ',', "'", ',', ' ', "'", '3', "'", ']']
>>> type(a)
<class 'list'>
>>> a[0]
'['
>>> a[0,1]
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: list indices must be integers or slices, not tuple
>>> a
['[', "'", '1', "'", ',', ' ', "'", ',', "'", ',', ' ', "'", '2', "'", ',', ' ', "'", ',', "'", ',', ' ', "'", '3', "'", ']']
>>> a[1]
"'"
>>> a.remove(,)File "<stdin>", line 1a.remove(,)^
SyntaxError: invalid syntax
>>> a
['[', "'", '1', "'", ',', ' ', "'", ',', "'", ',', ' ', "'", '2', "'", ',', ' ', "'", ',', "'", ',', ' ', "'", '3', "'", ']']
>>> a.remove(1)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
ValueError: list.remove(x): x not in list
>>> a.remove(2)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
ValueError: list.remove(x): x not in list
>>> len(a)
25
>>> len([)File "<stdin>", line 1
SyntaxError: closing parenthesis ')' does not match opening parenthesis '['
>>> a.remove([)File "<stdin>", line 1
SyntaxError: closing parenthesis ')' does not match opening parenthesis '['
>>> del a[0]
>>> a
["'", '1', "'", ',', ' ', "'", ',', "'", ',', ' ', "'", '2', "'", ',', ' ', "'", ',', "'", ',', ' ', "'", '3', "'", ']']
>>> a.reverse()
>>> a
[']', "'", '3', "'", ' ', ',', "'", ',', "'", ' ', ',', "'", '2', "'", ' ', ',', "'", ',', "'", ' ', ',', "'", '1', "'"]
>>> a.remove(",")
>>> a
[']', "'", '3', "'", ' ', "'", ',', "'", ' ', ',', "'", '2', "'", ' ', ',', "'", ',', "'", ' ', ',', "'", '1', "'"]
>>> a.remove(')File "<stdin>", line 1a.remove(')^
SyntaxError: EOL while scanning string literal
>>> a.remove(2)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
ValueError: list.remove(x): x not in list
>>> a.remove("2")
>>> a
[']', "'", '3', "'", ' ', "'", ',', "'", ' ', ',', "'", "'", ' ', ',', "'", ',', "'", ' ', ',', "'", '1', "'"]
>>> a.appenda(1,2)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
AttributeError: 'list' object has no attribute 'appenda'
>>> a.append(1,2)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: append() takes exactly one argument (2 given)
>>> a.extend(a,a)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: extend() takes exactly one argument (2 given)
>>> a
[']', "'", '3', "'", ' ', "'", ',', "'", ' ', ',', "'", "'", ' ', ',', "'", ',', "'", ' ', ',', "'", '1', "'"]
>>> a.extend(a)
>>>
>>> a
[']', "'", '3', "'", ' ', "'", ',', "'", ' ', ',', "'", "'", ' ', ',', "'", ',', "'", ' ', ',', "'", '1', "'", ']', "'", '3', "'", ' ', "'", ',', "'", ' ', ',', "'", "'", ' ', ',', "'", ',', "'", ' ', ',', "'", '1', "'"]
>>> len(a)
44
>>> a
[']', "'", '3', "'", ' ', "'", ',', "'", ' ', ',', "'", "'", ' ', ',', "'", ',', "'", ' ', ',', "'", '1', "'", ']', "'", '3', "'", ' ', "'", ',', "'", ' ', ',', "'", "'", ' ', ',', "'", ',', "'", ' ', ',', "'", '1', "'"]
>>> a.append(1)
>>> a
[']', "'", '3', "'", ' ', "'", ',', "'", ' ', ',', "'", "'", ' ', ',', "'", ',', "'", ' ', ',', "'", '1', "'", ']', "'", '3', "'", ' ', "'", ',', "'", ' ', ',', "'", "'", ' ', ',', "'", ',', "'", ' ', ',', "'", '1', "'", 1]
>>> len(a)
45
>>> p=liat(reversed(a))
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'liat' is not defined
>>> p=list(reversed(a))
>>> p
[1, "'", '1', "'", ',', ' ', "'", ',', "'", ',', ' ', "'", "'", ',', ' ', "'", ',', "'", ' ', "'", '3', "'", ']', "'", '1', "'", ',', ' ', "'", ',', "'", ',', ' ', "'", "'", ',', ' ', "'", ',', "'", ' ', "'", '3', "'", ']']
>>> a
[']', "'", '3', "'", ' ', "'", ',', "'", ' ', ',', "'", "'", ' ', ',', "'", ',', "'", ' ', ',', "'", '1', "'", ']', "'", '3', "'", ' ', "'", ',', "'", ' ', ',', "'", "'", ' ', ',', "'", ',', "'", ' ', ',', "'", '1', "'", 1]
>>> a==b
False
>>> a==p
False
>>> a
[']', "'", '3', "'", ' ', "'", ',', "'", ' ', ',', "'", "'", ' ', ',', "'", ',', "'", ' ', ',', "'", '1', "'", ']', "'", '3', "'", ' ', "'", ',', "'", ' ', ',', "'", "'", ' ', ',', "'", ',', "'", ' ', ',', "'", '1', "'", 1]
>>> p
[1, "'", '1', "'", ',', ' ', "'", ',', "'", ',', ' ', "'", "'", ',', ' ', "'", ',', "'", ' ', "'", '3', "'", ']', "'", '1', "'", ',', ' ', "'", ',', "'", ',', ' ', "'", "'", ',', ' ', "'", ',', "'", ' ', "'", '3', "'", ']']
>>> p=list(reversed(p))
>>> p==a
True
>>> c=3
>>> d=3
>>> c==d
True
>>> e=1+2
>>> e
3
>>> c==e
True
>>> d==e
True
>>> e==3
True
>>> "3" in a
True
>>> a.index(3)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
ValueError: 3 is not in list
>>> a.index("3")
2
>>> 3 in a
False
>>> sum(1+1)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: 'int' object is not iterable
>>> sum(c,2)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: 'int' object is not iterable
>>> c
3
>>> a
[']', "'", '3', "'", ' ', "'", ',', "'", ' ', ',', "'", "'", ' ', ',', "'", ',', "'", ' ', ',', "'", '1', "'", ']', "'", '3', "'", ' ', "'", ',', "'", ' ', ',', "'", "'", ' ', ',', "'", ',', "'", ' ', ',', "'", '1', "'", 1]
>>> b
[3, '1', 3, [...], '1', 'a', 3, [...], '1', 3, [...], '1', 'a']
>>> sum(b,1)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'int' and 'str'
>>> o=[1,2,6]
>>> o
[1, 2, 6]
>>> sum(o,2)
11
>>> max(o)
6
>>> min(o)
1

两个小数相加的和跟确切的值比较输出False

>>> c=6+3
>>> 9==c
True
>>> c==9
True
>>> 4.2+36
40.2
>>> c=3.6+2
>>> d=3+2.6
>>> c==d
True
>>> d=2.2+3.4
>>> c==d
True
>>> print(c)
5.6
>>> 5.6==c
True
>>> 4.2+2==6.2
True
>>> 4.2+2.1==6.3
False
>>> c=6.3
>>> 3.6+2.0
5.6
>>> 3.6+2==5.6
True
>>> 3.6+2.0==5.6
True

字典

在这里插入图片描述
创建一个字典
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述update用法:

>>> student = dict.fromkeys(a)
>>> student
{']': None, "'": None, '3': None, ' ': None, ',': None, '1': None, 1: None}
>>> school={}
>>> school
{}
>>> school["name:"]="pdsu"
>>> school
{'name:': 'pdsu'}
>>> school["name:"] = o
>>> school
{'name:': [1, 2, 6]}
>>> school.update(num=o)
>>> school
{'name:': [1, 2, 6], 'num': [1, 2, 6]}
>>> school.update(beizhu=student)
>>> school
{'name:': [1, 2, 6], 'num': [1, 2, 6], 'beizhu': {']': None, "'": None, '3': None, ' ': None, ',': None, '1': None, 1: None}}
>>> school.update(small="pp","oo",11,"11")File "<stdin>", line 1
SyntaxError: positional argument follows keyword argument
>>> school.update(small="pp")
>>> school
{'name:': [1, 2, 6], 'num': [1, 2, 6], 'beizhu': {']': None, "'": None, '3': None, ' ': None, ',': None, '1': None, 1: None}, 'small': 'pp'}
>>> school.update(big="a",big="b")File "<stdin>", line 1
SyntaxError: keyword argument repeated
>>> school.update(big="big",big="aa")File "<stdin>", line 1
SyntaxError: keyword argument repeated
>>> school.update(big="aa",ok="aa")
>>> school
{'name:': [1, 2, 6], 'num': [1, 2, 6], 'beizhu': {']': None, "'": None, '3': None, ' ': None, ',': None, '1': None, 1: None}, 'small': 'pp', 'big': 'aa', 'ok': 'aa'}
>>> school.update(qq="l"+1)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: can only concatenate str (not "int") to str
>>> school.update(school)
>>> school
{'name:': [1, 2, 6], 'num': [1, 2, 6], 'beizhu': {']': None, "'": None, '3': None, ' ': None, ',': None, '1': None, 1: None}, 'small': 'pp', 'big': 'aa', 'ok': 'aa'}
>>> a={"pokr":1,"age"=7)File "<stdin>", line 1a={"pokr":1,"age"=7)^
SyntaxError: invalid syntax
>>> a={"poke"="c")File "<stdin>", line 1a={"poke"="c")^
SyntaxError: invalid syntax
>>> a = {"poke":1,"a":3)File "<stdin>", line 1
SyntaxError: closing parenthesis ')' does not match opening parenthesis '{'
>>> a
[']', "'", '3', "'", ' ', "'", ',', "'", ' ', ',', "'", "'", ' ', ',', "'", ',', "'", ' ', ',', "'", '1', "'", ']', "'", '3', "'", ' ', "'", ',', "'", ' ', ',', "'", "'", ' ', ',', "'", ',', "'", ' ', ',', "'", '1', "'", 1]
>>> a={"a":1,"b":"1"}
>>> a
{'a': 1, 'b': '1'}
>>> school.update(a)
>>> school
{'name:': [1, 2, 6], 'num': [1, 2, 6], 'beizhu': {']': None, "'": None, '3': None, ' ': None, ',': None, '1': None, 1: None}, 'small': 'pp', 'big': 'aa', 'ok': 'aa', 'a': 1, 'b': '1'}
>>> b
[3, '1', 3, [...], '1', 'a', 3, [...], '1', 3, [...], '1', 'a']
>>> b={66.3:66}
>>> b
{66.3: 66}
>>> school.update(b)
>>> school
{'name:': [1, 2, 6], 'num': [1, 2, 6], 'beizhu': {']': None, "'": None, '3': None, ' ': None, ',': None, '1': None, 1: None}, 'small': 'pp', 'big': 'aa', 'ok': 'aa', 'a': 1, 'b': '1', 66.3: 66}

print易错:

>>> print("school['num']",school["num"])
school['num'] [1, 2, 6]
>>> print("school['num']:",school["num"])
school['num']: [1, 2, 6]
>>> print("''")
''
>>> print('""')
""
>>> print("school['num']:,school["nu"]:",school["num"])File "<stdin>", line 1print("school['num']:,school["nu"]:",school["num"])^
SyntaxError: invalid syntax
>>> print("school['num']:,school['s']:",school["num"])
school['num']:,school['s']: [1, 2, 6]
>>>
>>>> student
{'name': 10, 'age': 10}
>>> student
{'name': 10, 'age': 10}
>>> school
{'name:': [1, 2, 6], 'num': [1, 2, 6], 'beizhu': {']': None, "'": None, '3': None, ' ': None, ',': None, '1': None, 1: None}, 'small': 'pp', 'big': 'aa', 'ok': 'aa', 'a': 1, 'b': '1', 66.3: 66, 'type': 3, ']': None, "'": None, '3': None, ' ': None, ',': None, '1': None, 1: None}
>>> student = dict.fromkeys(("ss","ssss"),3)
>>> student = dict.fromkeys(("ss","ssss",ppp),3)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'ppp' is not defined
>>> student = dict.fromkeys(("ss","ssss"),3)
>>> student
{'ss': 3, 'ssss': 3}
>>> student = dict.fromkeys(("ss","ssss",ppp),3)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'ppp' is not defined
>>> student = dict.fromkeys(("ss","ssss","ppp"),3)
>>> student = dict,fromkeys(("aa","'ff'",3),4)
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'fromkeys' is not defined
>>> student = dict.fromkeys(("aa","'ff'",3),4)
>>> student
{'aa': 4, "'ff'": 4, 3: 4}

fromkeys使用:元素数量为被命名数量
参数为字符串则字符串内部每个元素都被使用成KEY
参数为列表,元素数量为被命名数量
key的名称类型只能是不可变的数据类型:元组、字符串、数字类型,若所给参数不是不可变类型

>>>student=dict.fromkeys(("name","sex","age"),"none")
{'name': 'none', 'sex': 'none', 'age': 'none'}
>>> example=student.fromkeys("qwer,.?")
>>> example
{'q': None, 'w': None, 'e': None, 'r': None, ',': None, '.': None, '?': None}
>>> p="qwer,.?"
>>> len(p)
7
>>> student.get(("name"))
'wpm'
>>> student
{'sex': '男', 'age': 16, 'name': 'wpm'}
>>> student["name"]="www"
>>> student
{'sex': '男', 'age': 16, 'name': 'www'}
>>> a
('name', 1)
>>> student[a]="nihao world"
>>> student
{'sex': '男', 'age': 16, 'name': 'www', ('name', 1): 'nihao world'}
>>> "男" in student
False
>>> "男" in student.values()
True
>>>>>>

集合
创建集合:

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.luyixian.cn/news_show_24002.aspx

如若内容造成侵权/违法违规/事实不符,请联系dt猫网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

08 字符串连接符 “+“ 导致的 check cast 的省略

前言 // 年轻时候&#xff0c;到了冬天&#xff0c;家人让你穿秋裤&#xff0c;你不仅不穿秋裤&#xff0c;还露着脚脖子&#xff0c;如果有人劝你&#xff0c;你会嫌他唠叨。而等你岁数大一点&#xff0c;天气一冷&#xff0c;身体受不了&#xff0c;就自觉把秋裤穿上了。 呵…

图论二分图问题讲解-染色法和匈牙利算法

二分图 概述&#xff1a; 二分图又称作二部图&#xff0c;是图论中的一种特殊模型。 设G(V,E)是一个无向图&#xff0c;如果顶点V可分割为两个互不相交的子集(A,B)&#xff0c;并且图中的每条边&#xff08;i&#xff0c;j&#xff09;所关联的两个顶点i和j分别属于这两个不同的…

使用Python将微信和支付宝账单导入随手记

简介 本文介绍如何使用Python将微信和支付宝账单转换为可以导入随手记的文件&#xff0c;实现微信和支付宝账单的批量导入。 需求&#xff1a; 1、需要将支付宝和微信上的支出账单自动或半自动地导入到随手记中 已知信息&#xff1a; 1、支付宝和微信的app端都可以导出csv…

引导过程与服务控制

目录: 1、引导过程总览 2、备份与恢复第一块硬盘前512字节 3、修复GRUB引导故障 4、忘记密码 5、开关系统服务控制Linux操作系统引导过程引导过程总览: 开机自检→MBR引导→GRUB菜单→加载内核→init进程初始化 1、bios 检查硬件设置grub功能和组成 bootloader:引导加载器,…

npm install ,npm ERR code 401 Incorrect or missing password 错误原因与.npmrc 配置文件的使用

前言&#xff1a;前端去维护项目时&#xff0c;通过 git clone 下来以后&#xff0c;经常是直接 npm install 去安装项目需要的 node_modules &#xff0c;但是往往很多项目不是我们自己写的&#xff0c;或者从 GitHub 上面 clone 的开源项目&#xff0c;这个时候出现问题就很难…

【ASM】字节码操作 转换已有的类 ClassReader 删除方法 添加方法

文章目录 1.概述2.案例2.1 删除方法2.2 添加方法2.3小总结3.总结1.概述 上一篇文章:【ASM】字节码操作 转换已有的类 ClassReader 修改字段信息 删除字段 增加字段 在上一篇文章中我们学到了如何添加字段与删除字段。 本章节我们来尝试修改方法和删除方法。 2.案例 2.1 删…

搜索查找类

查找搜索类\color{blue}{\huge{查找搜索类}}查找搜索类 find find指令从指定目录向下递归地便利各个子目录&#xff0c;如果在/root目录下进行寻找&#xff0c;根据文件目录的树状结构&#xff0c;就是进行全盘查找&#xff0c;非常浪费时间&#xff0c;所以使用find 进行寻找…

MATLAB | 绘图复刻(二) | 折线图+误差棒+柱状图+散点抖动+灰色背景+图片叠加

看到gzh R语言ggplot2科研绘图发布了一篇绘图复刻类文章&#xff0c;复刻了&#xff1a; Nature(IF49.962)文章(Gut microbiota modulates weight gain in mice after discontinued smoke exposure)其中的Figure.1b&#xff0c;绘制效果十分惊艳&#xff0c;手痒就想拿MATLAB也…

RocketMQ 消费者Rebalance算法 解析——图解、源码级解析

&#x1f34a; Java学习&#xff1a;Java从入门到精通总结 &#x1f34a; 深入浅出RocketMQ设计思想&#xff1a;深入浅出RocketMQ设计思想 &#x1f34a; 绝对不一样的职场干货&#xff1a;大厂最佳实践经验指南 &#x1f4c6; 最近更新&#xff1a;2022年10月15日 &#…

(附源码)计算机毕业设计大学生网上书店

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

(附源码)计算机毕业设计电脑外设销售系统小程序

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

操作系统基本功能(操作系统)

目录 一、处理机管理 二、存储器管理 三、设备管理 四、文件管理 五、作业管理 一、处理机管理 中央处理机&#xff08;CPU&#xff09;是计算机系统中一个举足轻重的资源。用户程序进入内存后&#xff0c;只有获得CPU&#xff0c;才能真正得以运行。 为了提高CPU的利用率…

前端都应该了解的 NodeJs 知识及原理浅析

node.js 初探 Node.js 是一个 JS 的服务端运行环境&#xff0c;简单的来说&#xff0c;它是在 JS 语言规范的基础上&#xff0c;封装了一些服务端的运行时对象&#xff0c;让我们能够简单实现非常多的业务功能。 如果我们只使用 JS 的话&#xff0c;实际上只是能进行一些简单…

docker mysql8使用SSL及使用openssl生成自定义证书

《docker安装MySQL8》 修改my.cnf vi /docker_data/mysql/conf/my.cnf[client] default-character-setutf8mb4 [mysql] default-character-setutf8mb4 [mysqld] character-set-serverutf8mb4 default_authentication_pluginmysql_native_password #增加ssl ssl保存&#xff0…

【让你从0到1学会c语言】文件操作

作者&#xff1a;喜欢猫咪的的程序员 专栏&#xff1a;《C语言》 喜欢的话&#xff1a;世间因为少年的挺身而出&#xff0c;而更加瑰丽。 ——《人民日报》 目录 什么是文件&#xff1a; 我们为什么要使用文件呢&#xff1f; 文件分类&#x…

rbf神经网络和bp神经网络,rbf神经网络百度百科

1、rbf神经网络算法是什么? RBF神经网络算法是由三层结构组成&#xff0c;输入层至隐层为非线性的空间变换&#xff0c;一般选用径向基函数的高斯函数进行运算&#xff1b;从隐层至输出层为线性空间变换&#xff0c;即矩阵与矩阵之间的变换。 RBF神经网络进行数据运算时需要…

基于springboot的旅游打卡攻略分享小程序

&#x1f496;&#x1f496;作者&#xff1a;IT跃迁谷毕设展 &#x1f499;&#x1f499;个人简介&#xff1a;曾长期从事计算机专业培训教学&#xff0c;本人也热爱上课教学&#xff0c;语言擅长Java、微信小程序、Python、Golang、安卓Android等。平常会做一些项目定制化开发…

预处理的补充知识

&#x1f3d6;️作者&#xff1a;malloc不出对象 ⛺专栏&#xff1a;《初识C语言》 &#x1f466;个人简介&#xff1a;一名双非本科院校大二在读的科班编程菜鸟&#xff0c;努力编程只为赶上各位大佬的步伐&#x1f648;&#x1f648; 目录一、宏的补充知识1.1 宏定义充当注释…

MABSA(Multimodal Aspect-Based Sentiment Analysis)2022ACL 预训练

大致浏览&#xff0c;没有细看。 论文题目&#xff08;Title&#xff09;&#xff1a; Vision-Language Pre-Training for Multimodal Aspect-Based Sentiment Analysis 研究问题&#xff08;Question&#xff09;&#xff1a;多模态情感分析 MABSA (Multimodal Aspectased S…

黑马程序员Java零基础视频教程(2022最新Java)B站视频学习笔记-Day14-面向对象进阶02

1、权限修饰符和代码块 1.1 权限修饰符 权限修饰符&#xff1a;是用来控制一个成员能够被访问的范围的。 可以修饰&#xff1a;成员变量、方法、构造方法、内部类。 巧计举例&#xff1a; private--------私有的----------相当于私房钱&#xff0c;只能自己用 默认--------…