- 1
Can someone explain to me in easy way the use of random and randint please
random(0,9)
5 Answers
+ 8
ok @awesome pls kindly view my comment on d code. I will appreciate any help
+ 4
Important to remember though that random.randint treats both ends of the range argument INCLUSIVELY (unlike range(), which only has its left edge sharp).
range: <x, y)
randint: <x, y>
+ 3
randint is like range
range would go through all numbrs
but randint would choose a number
between it
example
from random import randint
randint(0,50)
prints a random number from 0-50
check out my profile for a code using randint
its called rock paper scissor
+ 2
edit: i also have another code using randint
its very simple
check it out
you can understans randint thru it
- 1
random.random() works the same but returns a random floating point number from 0 to 1.