mardi 23 mai 2017

How to generate 2 pairs of random numbers 100 times.

I have two variables which I have assigned to be random numbers like below:

x = random.randrange(1, 100)
n = random.randrange(1, 100)

These variables are then used to calculate x^n which I have written code for in another function. However instead of producing one random number for x and one random number for n I need to produce 100 random numbers for each and then run them through the loop that calculates x^n for all 100 numbers. I'm not sure on how to produce 100 random numbers for x and n while still keeping their variables the same.




Aucun commentaire:

Enregistrer un commentaire