generate functionTue, 07 Mar 2023

print a random number in the range from 0 to n where n is a fractional number

from random import randint from random import uniform def rand_num(n): return uniform(0, n) rand_num(1.5)

Questions about programming?Chat with your personal AI assistant