1.

Give an example of “random()”

Answer»

The following example shows the usage of random() method.

# !/usr/bin/python 

import random 

# First random number 

print “random(): ” , 

random.random() # Second random number print “random(): “, 

random.random() 

This will produce the following results 

random(): 0.281954791393 

random(): 0.309090465205



Discussion

No Comment Found