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

本站现有博文321篇,共被浏览773876

本站已经建立2463天!

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