Talvieno

Short thing

May 23rd, 2016
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. deleted = 0
  2. allLength = sum(1 for line in open('C:/Users/Nathan/PycharmProjects/untitled/Wiki Input.txt'))
  3. with open('C:/Users/Nathan/PycharmProjects/untitled/Wiki Input.txt', 'r') as fileContents:
  4.     for i, line in enumerate(fileContents, 1):
  5.         if "--" in line:
  6.             deleted += 1
  7.         if "* LATER" in line:
  8.             allLength = i
  9. print(str(round((100.0 / float(allLength)) * deleted)) + "% complete pre-mission, " + str(round((100.0 / float(sum(1 for line in open('C:/Users/Nathan/PycharmProjects/untitled/Wiki Input.txt'))) * deleted))) + "% complete total")
Advertisement
Add Comment
Please, Sign In to add comment