如何将30个数随机排列

import random
import numpy as np
arr = [];
i = 1;
while len(arr) < 30:
    x = random.randint(0, 30);
    if x not in arr:
        arr.append(x)
    else:
        pass
print(arr)

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