Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- pop_num = []
- inFile = open ("Census_2009a.txt", "r")
- count = 0
- for line in inFile:
- if (count == 0):
- count += 1
- continue
- else:
- count += 1
- line = line.strip()
- word_list = line.split()
- pop_num.append (word_list[-1])
- inFile.close()
- print (pop_num)
- print (count-1)
- first_dig = []
- for i in range (count-1):
- first_dig.append(pop_num[i][:1])
- print(first_dig)
- counter = 0
- for j in range (1, 10):
- for k in range (count - 1):
- #print(j, first_dig[k - 1])
- if (j == int(first_dig[k])):
- counter += 1
- print(j, counter, counter / (count - 1) * 100)
- counter = 0
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement