Python Random Module-W3Schools
Python Random Module-W3Schools
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
Python has a built-in module that you can use to make random numbers.
Method Description
choices() Returns a list with a random selection from the given sequence
https://www.w3schools.com/python/module_random.asp 1/5
5/22/25, 9:38 AM Python Random Module
uniform()
Tutorials Returns a random float number between
Exercises Services two given parametersSign In
Get Certified
triangular() Returns a random float number between two given parameters,
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
you can also set a mode parameter to specify the midpoint
between the two other parameters
❮ Previous Next ❯
https://www.w3schools.com/python/module_random.asp 2/5
5/22/25, 9:38 AM Python Random Module
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
COLOR PICKER
https://www.w3schools.com/python/module_random.asp 3/5
5/22/25, 9:38 AM Python Random Module
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
PLUS SPACES
Top Tutorials
HTML Tutorial
CSS Tutorial
JavaScript Tutorial
How To Tutorial
SQL Tutorial
Python Tutorial
W3.CSS Tutorial
Bootstrap Tutorial
PHP Tutorial
Java Tutorial
C++ Tutorial
jQuery Tutorial
Top References
HTML Reference
CSS Reference
JavaScript Reference
SQL Reference
Python Reference
https://www.w3schools.com/python/module_random.asp 4/5
5/22/25, 9:38 AM Python Random Module
W3.CSS Reference
Copyright 1999-2025 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.
https://www.w3schools.com/python/module_random.asp 5/5