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

本站现有博文309篇,共被浏览735752

本站已经建立2372天!

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