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

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

本站已经建立2463天!

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