
python
菜得你想哭
好好学习,天天向上
展开
-
2020-12-20
大数相减 计算n个a相减-Python-未解决a = list(map(int, input().split(" ")))b = (10 ** (a[1]) - 1) / 9c = 0print(b)for x in range(1, a[1]): c += (10 ** x - 1) / 9 # print(c)d = (b - c) * a[0]print(int(d))问题:当n<10时,程序的到结果正常,但当n>10时,程序出现问题:...原创 2020-12-20 10:47:05 · 5052 阅读 · 2 评论 -
关于numpy.shape(1)
import numpy as npn = np.array([ [1,0,0], [0,1,0], [0,0,1], [1,1,1]])print(n.shape[0])print(n.shape[1])得到的结果为由此可得当shape[0]时,得到的是矩阵的行数当shape[1]时,得到的是矩阵的列数...原创 2020-07-19 17:22:33 · 1407 阅读 · 1 评论