Can someone please explain how to use a rng in python! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can someone please explain how to use a rng in python!

I was looking at rngs online and I couldn't figure out how to do it. Thanks!

13th Apr 2017, 5:04 PM
William Atkinson
William Atkinson - avatar
2 Answers
+ 1
thanks
14th Apr 2017, 1:21 AM
William Atkinson
William Atkinson - avatar
0
import random print(random.randint(0,10)) that prints a random number between 0 and 10. import random myList=[1,2,3] print(random.choice(myList)) that prints a random element from the list. what exactly do you want to know? *Do not name a script random.py. it screws up importing the random module
14th Apr 2017, 12:14 AM
LordHill
LordHill - avatar