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

本站现有博文322篇,共被浏览786848

本站已经建立2481天!

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