#!/usr/bin/env python3
###################################################################################
# Python function to create random numbers
###################################################################################
print("Content-Type: text/html \n")         #http header with newline char (required for the web)

import math
import random                               #import the random module

#seed = random.seed(12345678)               #set a seed to enable repeated random numbers

print('<pre>')                              #to produce better display on the web 

for n in range(10):
    x = random.random()                     #a random number between 0 and .999999999
    y = math.floor(x*10) + 1                #a random number between 1 and 10
    print(F"raw num: {x} --> {y}")

print()

for n in range(10):
    dice1 = random.randint(1,6)              #a random number between 1 and 6
    dice2 = random.randint(1,6)
    print(F"throw dice -> {dice1} and {dice2}")

print()

for n in range(10):
    rand = random.randint(-999,999)         #a random number between -999 and 999
    print(n,'->',rand)