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

本站现有博文312篇,共被浏览745285

本站已经建立2390天!

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