Skip to content

Instantly share code, notes, and snippets.

@colleowino
Created October 19, 2017 23:52
Show Gist options
  • Save colleowino/fda6eab438c91fecc184fcccb71ce68b to your computer and use it in GitHub Desktop.
Save colleowino/fda6eab438c91fecc184fcccb71ce68b to your computer and use it in GitHub Desktop.
Using this file writing utility to get test data for kattis
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