Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. def who_is_missing(file_name):
  2. opened_file = open(file_name, "r")
  3. file = opened_file.read()
  4. list = file.split(',')
  5. max = '0'
  6. for k in list:
  7. if k > max:
  8. max = k
  9. for i in range (1, int(max) + 1):
  10. if str(i) not in list and str(i) > '0' and str(i) < str(max):
  11. opened_file.close()
  12. file = open(file_name, "r+")
  13. num = str(i)
  14. file.write(num)
  15. return i
  16.  
  17.  
  18. def main():
  19. pass
  20.  
  21. if __name__ == "__main__":
  22. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement