for i in range(number_of_numbers):
randomNumber = randint(1, pow(10, numberPower))
numbers.append(randomNumber)
numbersIncreasing.append(randomNumber)
So I'm making a little math game that generates n amount of numbers from user input. This is the code that generates the numbers and appends them to a list. The only problem is, is it gives numbers with the same amount of digits, which is whatever numberPower is set to (12). An example would be two numbers like 9,564,713,666,123 or 1,256,286,233,753, and all the numbers have 12 digits. I was expecting more very mixed numbers, that could literally be anywhere between 1 and 10^12.
Aucun commentaire:
Enregistrer un commentaire