0

how to generate a random number with python

for a rand.password generator

7th Nov 2020, 7:57 AM
× SThulaswe ×
× SThulaswe × - avatar
5 Answers
0
from random import* a=randint(0,10) print(a) a is a random integer between 0 and 10
7th Nov 2020, 8:11 AM
Hougo
+ 2
import random num=random.randint(5, 10) # radius from 5 to 10
7th Nov 2020, 8:10 AM
Operand
Operand - avatar
+ 1
thanks friends
7th Nov 2020, 8:16 AM
× SThulaswe ×
× SThulaswe × - avatar
+ 1
but what is import random. is it nesscesary to generate rand int
7th Nov 2020, 8:19 AM
× SThulaswe ×
× SThulaswe × - avatar
0
randint( 0, 10) out put 0 to 10 or between them
7th Nov 2020, 8:20 AM
× SThulaswe ×
× SThulaswe × - avatar