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

本站现有博文337篇,共被浏览961875次

本站已经建立2674天!

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