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

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

本站已经建立2629天!

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