Skip to content

Commit

Permalink
Code files added
Browse files Browse the repository at this point in the history
  • Loading branch information
packtpavanr authored Jul 27, 2017
1 parent 138f83e commit 36bd930
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Chapter05/create_random_nums.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import random

my_range = range(1, 100000)

def random_nums(num):
for i in range(num):
nums = random.sample(my_range, 100)
open('numbers_%d.txt' % i,'w').writelines(map(lambda x: str(x)+'\n',
nums))
random_nums(1000000)

0 comments on commit 36bd930

Please sign in to comment.