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

本站现有博文340篇,共被浏览1019260次

本站已经建立2719天!

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