Python Generating Random numbers

Python random  module contains function to generate random numbers. So first you need to import random  module using the following line.

import random

random() Function

random()  function returns random number r  such that 0 <= r < 1.0

Expected Output:

randint(a, b)  generate random numbers between a  and b  (inclusively).

Next chapter will cover file handling techniques in python.

Leave a Reply

Be the First to Comment!

Notify of
avatar

wpDiscuz