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

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

本站已经建立2583天!

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