EADST

Python: Get A List of Different Random Numbers

Only one line can get a list of different random numbers (sampling without replacement). Here is the code.

import random

print(random.sample(range(1, 10), 5))
# output: [5, 8, 4, 1, 7]
相关标签
About Me
XD
Goals determine what you are going to be.
Category
标签云
PyTorch Django JSON XML QWEN Git Diagram Jupyter Bitcoin 多进程 Bin 第一性原理 Sklearn API Video logger ONNX Plotly UI Datetime Google 阿里云 UNIX 飞书 Data git C++ FP64 Nginx InvalidArgumentError TTS Domain Template Proxy Bipartite 域名 FP16 Pillow Color Quantization Qwen2.5 transformers IndexTTS2 EXCEL tqdm Freesound torchinfo VPN Search Qwen2 DeepSeek 云服务器 Translation Agent PyCharm CUDA Miniforge News HaggingFace Numpy Pandas VGG-16 Shortcut Bert Windows hf GPT4 Review TSV Permission Hilton SPIE Dataset icon Paddle Python 算法题 BeautifulSoup GIT Clash Card YOLO LeetCode LoRA Vim GPTQ Augmentation Base64 强化学习 PDB git-lfs Hungarian SQL MD5 净利润 LLAMA Statistics Crawler XGBoost Jetson Conda Rebuttal 证件照 Heatmap Llama 关于博主 Excel Pytorch HuggingFace AI 签证 OpenCV Tiktoken Claude Use Tensor PDF CV RAR Website 报税 FP8 SVR Food Qwen Ptyhon tar WAN 图形思考法 CSV Streamlit Distillation VSCode ModelScope Transformers GoogLeNet 版权 TensorFlow DeepStream 腾讯云 v2ray COCO OpenAI Paper Web v0.dev Interview ChatGPT Github Vmess FastAPI TensorRT Pickle PIP BTC Plate Linux Animate GGML 音频 Mixtral Input diffusers CAM Safetensors Knowledge LLM Firewall 图标 WebCrawler Anaconda Attention Baidu CLAP NLTK Magnet Gemma FlashAttention SAM Logo 财报 Image2Text llama.cpp Land RGB mmap 顶会 OCR SQLite Michelin Hotel Tracking Random BF16 uWSGI 公式 LaTeX 多线程 NLP Markdown Algorithm printf ResNet-50 Password CTC Docker CC 递归学习法 Zip Ubuntu Quantize FP32 搞笑 uwsgi CEIR NameSilo scipy Cloudreve Breakpoint Disk 继承 Math
站点统计

本站现有博文323篇,共被浏览804304

本站已经建立2504天!

热门文章
文章归档
回到顶部