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

本站现有博文328篇,共被浏览837356

本站已经建立2541天!

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