python3(二)刷题遇到的知识点
2021-03-19 06:25
阅读:744
标签:app content ini head pre containe nim panel UNC
1.定义数组,初始化数组
我习惯性写成了这样:错误
count = int[60]
正确定义:
count = [0]*60
当然,还可以借用numpy库生成数组,可以得到多维数组:
print(np.zeros(3)) print(np.zeros((3,3))) print(np.zeros((4,3,2)))
结果:
[0. 0. 0.]
[[0. 0. 0.] [0. 0. 0.] [0. 0. 0.]]
[[[0. 0.] [0. 0.] [0. 0.]] [[0. 0.] [0. 0.] [0. 0.]] [[0. 0.] [0. 0.] [0. 0.]] [[0. 0.] [0. 0.] [0. 0.]]]
python3(二)刷题遇到的知识点
标签:app content ini head pre containe nim panel UNC
原文地址:https://www.cnblogs.com/leechee9/p/13949723.html
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:python3(二)刷题遇到的知识点
文章链接:http://soscw.com/index.php/essay/66119.html
文章标题:python3(二)刷题遇到的知识点
文章链接:http://soscw.com/index.php/essay/66119.html
评论
亲,登录后才可以留言!