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

本站现有博文333篇,共被浏览924518

本站已经建立2631天!

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