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

本站现有博文323篇,共被浏览795588

本站已经建立2493天!

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