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

本站现有博文333篇,共被浏览913661

本站已经建立2616天!

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