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

本站现有博文329篇,共被浏览858681

本站已经建立2567天!

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