|
Oktatás * Programozás 1 * Szkriptnyelvek Teaching * Programming 1 (BI) Félévek Linkek * kalendárium |
Nim2 /
randint()Get a random integer from a closed interval.
Possible output: 3 1 3 1 2 Every time you execute these programs, they'll produce different numbers. But the numbers fall in the [1, 3] closed interval. Python initializes the random number generator with a different seed every time you launch your program. Nim doesn't do this implicitly. To get this result, you must call Warning! If you forget to call
𝥶Now, if you execute the program, it'll produce the same random numbers in the same order. What is it good for? To be able to reproduce an experiment, for instance. |
![]() Blogjaim, hobbi projektjeim * The Ubuntu Incident [ edit ] |
||||||||