Sample code for 30+ languages & platforms
Chilkat2-Python

Generating Random Integer in Range

See more PRNG Examples

Demonstrates how to generate random integers in a specified range.

Chilkat Chilkat2-Python Downloads

Chilkat2-Python
import chilkat2

success = False

# This example assumes the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.

success = False

fortuna = chilkat2.Prng()

# Generate random integers between 12 and 24 inclusive

for i in range(0,101):
    print(str(fortuna.RandomInt(12,24)))