
- Python 3 Basic Tutorial
- Python 3 - Home
- What is New in Python 3
- Python 3 - Overview
- Python 3 - Environment Setup
- Python 3 - Basic Syntax
- Python 3 - Variable Types
- Python 3 - Basic Operators
- Python 3 - Decision Making
- Python 3 - Loops
- Python 3 - Numbers
- Python 3 - Strings
- Python 3 - Lists
- Python 3 - Tuples
- Python 3 - Dictionary
- Python 3 - Date & Time
- Python 3 - Functions
- Python 3 - Modules
- Python 3 - Files I/O
- Python 3 - Exceptions
Why do we use random.seed() in Python?
The seed() method of random module initializes the random number generator.
random.seed(a,b)
If a is omitted or None, the current system time is used. If randomness sources are provided by the operating system, they are used instead of the system time
If a is an int, it is used directly.
With version 2 (the default), a str, bytes, or bytearray object gets converted to an int and all of its bits are used.
With version 1 (provided for reproducing random sequences from older versions of Python), the algorithm for str and bytes generates a narrower range of seeds.
- Related Articles
- Why do we use pandas in python?
- Why do we use re.compile() method in Python regular expression?
- Why do we use "use strict" in JavaScript?
- Why do we use question mark literal in Python regular expression?
- Why do we use interfaces in Java?
- Why do we use brackets in BODMAS?
- Why do we Use JavaScript in HTML?
- Why do we use Convex Mirrors ?
- Why do we use JSON.stringify() method in jQuery?
- Why do we use DOCTYPES in HTML document?
- Why do we use modifiers in C/C++?
- Why do we use restrict qualifier in C++?
- Why do we use const qualifier in C++?
- Why do we use internal keyword in C#?
- Why do we use comma operator in C#?

Advertisements