Talvieno

Percentage Thing

May 16th, 2016
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. deleted = 0
  2. with open('C:/Users/Nathan/PycharmProjects/untitled/Wiki Input.txt', 'r') as fileNew:
  3.     fileContents = fileNew.read().splitlines()
  4. fileNew.close()
  5. for i in range(0,len(fileContents)):
  6.     if "--" in fileContents[i]:
  7.         deleted += 1
  8. print(str(round((100.0 / float(len(fileContents))) * deleted)) + "% complete")
  9. input("Press enter to quit")
Advertisement
Add Comment
Please, Sign In to add comment