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

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

本站已经建立2588天!

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