Javatpoint Logo
Javatpoint Logo

Python program to generate a random number

In Python programming, you can generate a random integer, doubles, longs etc . in various ranges by importing a "random" class.

Syntax:

First you have to import the random module and then apply the syntax:

See this example:

Output:

Python Basic Programs7



Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


B.Tech / MCA