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

本站现有博文332篇,共被浏览876110

本站已经建立2583天!

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