Saturday, 2 March 2019

Generate a Random Number in Python

# Program to generate a random number between 0 and 9
# import the random module
import random
print(random.randint(0,9))

Output:

5

1 comment:

Popular Posts

Categories

Android (21) AngularJS (1) Books (3) C (75) C++ (81) Data Strucures (4) Engineering (13) FPL (17) HTML&CSS (38) IS (25) Java (85) PHP (20) Python (84) R (68) Selenium Webdriver (2) Software (13) SQL (27)