Created
October 19, 2017 23:52
-
-
Save colleowino/fda6eab438c91fecc184fcccb71ce68b to your computer and use it in GitHub Desktop.
Using this file writing utility to get test data for kattis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
f = open("large.txt","w") #opens file with name of "test.txt" | |
countries = ["kenya","Uganda","Somalia","Ethiopia","Eritrea"] | |
limits = 5000 | |
totals = str(limits*len(countries)) | |
def println(text): | |
f.write(text+"\n") | |
println(totals) | |
for place in countries: | |
for i in range(limits): | |
println(place+" "+str(random.randint(1700,2015))) | |
println(totals) | |
for place in countries: | |
for i in range(limits): | |
println(place+" "+str(random.randint(1,limits))) | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment