Python如何使列表中元素同时扩大或缩小以及如何让列表中元素复制

import numpy as np
a = [511]
print(a)
print(type(a))
b = a*3
print(b)
c = np.array(a)
print(c)
print(type(c))
d = c*3
print(d)
D:/data/test.py
[511]
<class 'list'>
[511, 511, 511]
[511]
<class 'numpy.ndarray'>
[1533]

Process finished with exit code 0

 

    原文作者:不会编程的ITer
    原文地址: https://blog.csdn.net/Princeicon/article/details/109508308
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞