jeudi 2 janvier 2020

Does my code produce a pseudorandom or random number?

import time

point1 = time.time()

point2 = time.time()

point3 = time.time()

random_number = str((point1 + point2 - point3) * point1)

print(random_number[7])
print(random_number[8])
print(random_number[9])
print(random_number[10])

It was my homework to design an algorithm that prodeces pseudorandom numbers. Would the above code be concidered to be pseudorandom? I am assuming it could be called that because the number outcome is unpredictable but i just wanted to make sure. Also, how do i print all the numbers on the same line? When i do print(random_number[10][7][8][9]), i get an error. I dont want to print out all the numbers because the first few are almost always the same. Thanks for helping.




Aucun commentaire:

Enregistrer un commentaire