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

本站现有博文340篇,共被浏览1026636次

本站已经建立2721天!

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