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

本站现有博文321篇,共被浏览764903

本站已经建立2443天!

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