美文网首页
【Python】区分

【Python】区分

作者: 盐果儿 | 来源:发表于2022-11-25 17:08 被阅读0次

1. 数组追加元素

- 数组append函数

数组的append函数是直接改变原数组,要想得到追加后的返回值,需要直接打印原数组的数组名称。

(1)数组添加元素不限制数据类型。

(2)打印“a.append('b')”,输出“None”: The general design principle in Python is for functions that mutate an object in-place to return None

a = []

a.append('b')

- numpy数组append函数

Numpy的append函数是一个方法,有两个传入参数,数组名,追加值,返回是一个numpy数组。

a = []

b = np.append(a, 'b')

2. 写文件

3. 判断一个字符串是否包含指定字符串的方法

a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

b = "A"

result = zi in zimu

https://www.cnblogs.com/orangeJJJ/p/10109232.html

4. & 和 and 区别

https://blog.csdn.net/sinat_38682860/article/details/116304202

5. 数组中选择特定元素

https://www.cnpython.com/qa/1535281

相关文章

网友评论

      本文标题:【Python】区分

      本文链接:https://www.haomeiwen.com/subject/frlffdtx.html