simple random generator written in python