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

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

本站已经建立2493天!

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