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

本站现有博文324篇,共被浏览821459

本站已经建立2526天!

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