Python Random random() Method

❮ Random Methods


Example

Return random number between 0.0 and 1.0:

import random

print(random.random())
Try it Yourself »

Definition and Usage

The random() method returns a random floating number between 0 and 1.


Syntax

random.random()

Parameter Values

No parameters


❮ Random Methods

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.