This program generates 10 random floating-point numbers between x and 100, where x starts at 0 and increases by 1 in each iteration of the loop. The random.uniform() method from the random module is used to generate random floating-point numbers within a given range. Here's how the program works:
Note that in the first iteration of the loop, x is 0, so the random number generated will be between 0 and 100. In the second iteration, x is 1, so the random number generated will be between 1 and 100, and so on until the 10th iteration where x is 9 and the random number generated will be between 9 and 100.
import random for x in range(10): res = round(random.uniform(x, 100),3) print(res)
42.912 67.523 87.538 43.369 80.415 5.708 14.827 16.431 18.942 78.732
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions