Python random. Here's a question

Asked 2 years ago, Updated 2 years ago, 17 views

You want to extract 5 random values among real numbers between 0 and 10

I think you have to extract the value using a1=random.uniform (0,10) to make a mistake (the rest is almost an integer) Maybe I don't know...)

The same value keeps coming out when I run print(a1)

How do we calculate five different real numbers a1?

python

2022-09-22 19:59

1 Answers

I think you did a good job.?

If you want to extract five, repeat it five times

Effector code

back to see I'm good.

import random

list = []
for i in range(5):
    list.append(random.uniform(0, 10))

print(list)


2022-09-22 19:59

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.