Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Python: Generate Random Integer

📅 2010-Feb-01 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

Example: 3 <= randNum <= 99

import <a href="http://docs.python.org/library/random.html">random</a>
randNum = random.<a href="http://docs.python.org/library/random.html#random.randint">randint</a>(3, 99)