I am in the process of creating a simple random number generator in python for a school project. This is what I have so far:
import random
amnt = input('Please enter the amount of numbers you would like:')
for i in range(0,amnt):
x = random.randint(0,100000000)
print x
This has the desired result, it generates a set amount of random numbers based on the user input. The problem I need to solve now is how to export the numbers generated into one CSV file so that they can be analysed. I believe that the CSV module needs to be imported and implemented but I am not sure how to do this. I am trying to analyze the effectiveness of the random module in order to write an essay so being able to use excel to sort and filter the numbers would be very helpful. Any changes or modifications to the code would also be very much appreciated.
Aucun commentaire:
Enregistrer un commentaire