9951 explained code solutions for 126 technologies


pythonGenerating random numbers using numpy


import numpy

a = numpy.random.randint(0,10)
b = numpy.random.random(1)ctrl + c
randint(0,10)

returns a random interger in the (foo, bar) interval

random(1)

returns a random float in the 0.0 ... (foo) interval

import numpy

start the numpy library