Learning Python

Functions

Generate a random number

import random

def main:
    print(random.randrange(1, 10))

randint and seed

Absolute value

import random

def main:
    print(abs(-1))