How to generate a random number whicj same for all iteration | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to generate a random number whicj same for all iteration

17th Jul 2018, 4:10 PM
SREESHMA MK
3 Answers
+ 4
sreeshma if you want the random number to remain the same, instead of assigning the variable as random inside the iterations, assign a random number to a variable before the loops begin, then code the loop and use that variable. So it will be the same random number throughout. (until you restart the entire program and it becomes a new random number)
17th Jul 2018, 4:54 PM
Andre Daniel
Andre Daniel - avatar
+ 1
str(digit) ?
23rd Jul 2018, 4:56 AM
Satyam
0
how to convert a digit to word in python?
23rd Jul 2018, 4:49 AM
SREESHMA MK